/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('nlb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddServersToServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtoptyui****'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at sings (@), underscores (_), and hyphens (-).', example='ECS'),
      port?: int32(name='Port', description='The port that is used by the backend server to provide services. Valid values: **0 to 65535**. If you do not set this parameter, the default value **0** is used.

If multi-port forwarding is enabled, you do not need to set this parameter. The default value 0 is used. NLB forwards requests to the requested ports. To determine whether multi-port forwarding is enabled, call the [ListServerGroups](https://help.aliyun.com/document_detail/445895.html) operation and check the value of the **AnyPortEnabled** parameter.', example='443'),
      serverId?: string(name='ServerId', description='The backend server ID.

*   If the server group is of the **Instance** type, set this parameter to the IDs of **Elastic Compute Service (ECS) instances**, **elastic network interfaces (ENIs)**, or **elastic container instances**.
*   If the server group is of the **Ip** type, set ServerId to IP addresses.

This parameter is required.', example='i-bp67acfmxazb4p****'),
      serverIp?: string(name='ServerIp', description='The IP address of the backend server. If the server group type is **Ip**, set the ServerId parameter to IP addresses.', example='192.168.6.6'),
      serverType?: string(name='ServerType', description='The type of the backend server. Valid values:

*   **Ecs**: the ECS instance
*   **Eni**: the ENI
*   **Eci**: the elastic container instance
*   **Ip**: the IP address

This parameter is required.', example='Ecs'),
      weight?: int32(name='Weight', description='The weight of the backend server. Valid values: **0** to **100**. Default value: **100**. If this parameter is set to **0**, no requests are forwarded to the server.', example='100'),
    }
  ](name='Servers', description='The backend servers that you want to add.

>  You can add up to 200 backend servers in each call.

This parameter is required.'),
}

model AddServersToServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-atstuj3rtoptyui****'),
}

model AddServersToServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddServersToServerGroupResponseBody(name='body'),
}

/**
 * @summary Adds backend servers to a specified server group.
 *
 * @param request AddServersToServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddServersToServerGroupResponse
 */
async function addServersToServerGroupWithOptions(request: AddServersToServerGroupRequest, runtime: $RuntimeOptions): AddServersToServerGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.servers)) {
    bodyFlat['Servers'] = request.servers;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AddServersToServerGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds backend servers to a specified server group.
 *
 * @param request AddServersToServerGroupRequest
 * @return AddServersToServerGroupResponse
 */
async function addServersToServerGroup(request: AddServersToServerGroupRequest): AddServersToServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return addServersToServerGroupWithOptions(request, runtime);
}

model AssociateAdditionalCertificatesWithListenerRequest {
  additionalCertificateIds?: [ string ](name='AdditionalCertificateIds', description='The additional certificates. You can associate up to 15 additional certificates with a listener in each call.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The listener ID. Only TCPSSL listener IDs are supported.

This parameter is required.', example='lsn-bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model AssociateAdditionalCertificatesWithListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-93F8-7FF34B540710'),
}

model AssociateAdditionalCertificatesWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AssociateAdditionalCertificatesWithListenerResponseBody(name='body'),
}

/**
 * @summary Associates additional certificates with a listener that uses SSL over TCP.
 *
 * @description **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/615175.html) operation to query the status of the task:
 * *   If the listener is in the **Associating** state, the additional certificates are being associated.
 * *   If the listener is in the **Associated** state, the additional certificates are associated.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListenerWithOptions(request: AssociateAdditionalCertificatesWithListenerRequest, runtime: $RuntimeOptions): AssociateAdditionalCertificatesWithListenerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.additionalCertificateIds)) {
    body['AdditionalCertificateIds'] = request.additionalCertificateIds;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AssociateAdditionalCertificatesWithListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates additional certificates with a listener that uses SSL over TCP.
 *
 * @description **AssociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/615175.html) operation to query the status of the task:
 * *   If the listener is in the **Associating** state, the additional certificates are being associated.
 * *   If the listener is in the **Associated** state, the additional certificates are associated.
 *
 * @param request AssociateAdditionalCertificatesWithListenerRequest
 * @return AssociateAdditionalCertificatesWithListenerResponse
 */
async function associateAdditionalCertificatesWithListener(request: AssociateAdditionalCertificatesWithListenerRequest): AssociateAdditionalCertificatesWithListenerResponse {
  var runtime = new $RuntimeOptions{};
  return associateAdditionalCertificatesWithListenerWithOptions(request, runtime);
}

model AttachCommonBandwidthPackageToLoadBalancerRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the Internet Shared Bandwidth instance.

This parameter is required.', example='cbwp-bp1pzf0ym72pu3y76****'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model AttachCommonBandwidthPackageToLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model AttachCommonBandwidthPackageToLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachCommonBandwidthPackageToLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Associates an Internet Shared Bandwidth instance with a Network Load Balancer (NLB) instance.
 *
 * @param request AttachCommonBandwidthPackageToLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachCommonBandwidthPackageToLoadBalancerResponse
 */
async function attachCommonBandwidthPackageToLoadBalancerWithOptions(request: AttachCommonBandwidthPackageToLoadBalancerRequest, runtime: $RuntimeOptions): AttachCommonBandwidthPackageToLoadBalancerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.bandwidthPackageId)) {
    body['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AttachCommonBandwidthPackageToLoadBalancer',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates an Internet Shared Bandwidth instance with a Network Load Balancer (NLB) instance.
 *
 * @param request AttachCommonBandwidthPackageToLoadBalancerRequest
 * @return AttachCommonBandwidthPackageToLoadBalancerResponse
 */
async function attachCommonBandwidthPackageToLoadBalancer(request: AttachCommonBandwidthPackageToLoadBalancerRequest): AttachCommonBandwidthPackageToLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return attachCommonBandwidthPackageToLoadBalancerWithOptions(request, runtime);
}

model CancelShiftLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  zoneMappings?: [ 
    {
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone uses one vSwitch and one subnet.

This parameter is required.', example='vsw-sersdf****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the NLB instance.

>  You can specify only one zone ID in each call.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mapping between the zone and the vSwitch.

>  You can specify only one zone ID in each call.

This parameter is required.'),
}

model CancelShiftLoadBalancerZonesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model CancelShiftLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelShiftLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Adds the elastic IP address (EIP) and virtual IP address (VIP) of a zone to the DNS record.
 *
 * @description Before you call this operation, the zone of the Network Load Balancer (NLB) instance is removed from the DNS record by using the console or calling the [StartShiftLoadBalancerZones](https://help.aliyun.com/document_detail/2411999.html) API operation.
 *
 * @param request CancelShiftLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelShiftLoadBalancerZonesResponse
 */
async function cancelShiftLoadBalancerZonesWithOptions(request: CancelShiftLoadBalancerZonesRequest, runtime: $RuntimeOptions): CancelShiftLoadBalancerZonesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.zoneMappings)) {
    body['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CancelShiftLoadBalancerZones',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds the elastic IP address (EIP) and virtual IP address (VIP) of a zone to the DNS record.
 *
 * @description Before you call this operation, the zone of the Network Load Balancer (NLB) instance is removed from the DNS record by using the console or calling the [StartShiftLoadBalancerZones](https://help.aliyun.com/document_detail/2411999.html) API operation.
 *
 * @param request CancelShiftLoadBalancerZonesRequest
 * @return CancelShiftLoadBalancerZonesResponse
 */
async function cancelShiftLoadBalancerZones(request: CancelShiftLoadBalancerZonesRequest): CancelShiftLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return cancelShiftLoadBalancerZonesWithOptions(request, runtime);
}

model CreateListenerRequest {
  alpnEnabled?: boolean(name='AlpnEnabled', description='Specifies whether to enable Application-Layer Protocol Negotiation (ALPN). Valid values:

*   **true**
*   **false** (default)', example='false'),
  alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**: uses only HTTP 1.x. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0.
*   **HTTP2Only**: uses only HTTP 2.0.
*   **HTTP2Optional**: preferentially uses HTTP 1.x over HTTP 2.0. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0, and the priority of HTTP 1.0 is higher than the priority of HTTP 2.0.
*   **HTTP2Preferred**: preferentially uses HTTP 2.0 over HTTP 1.x. The priority of HTTP 2.0 is higher than the priority of HTTP 1.1, and the priority of HTTP 1.1 is higher than the priority of HTTP 1.0.

>  This parameter is required if **AlpnEnabled** is set to true.', example='HTTP1Only'),
  caCertificateIds?: [ string ](name='CaCertificateIds', description='The certificate authority (CA) certificate. This parameter is supported only by TCLSSL listeners.

>  You can specify only one CA certificate.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**
*   **false** (default)', example='false'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificate. This parameter is supported only by TCLSSL listeners.

>  You can specify only one server certificate.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='100'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endPort?: int32(name='EndPort', description='The last port in the listener port range. Valid values: **0** to **65535**. The port number of the last port must be greater than the port number of the first port.

>  This parameter is required when **ListenerPort** is set to **0**.', example='566'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period for idle connections. Unit: seconds.

*   If you set **ListenerProtocol** to **TCP** or **TCPSSL**, this parameter can be set to a value ranging from **10** to **900**. Default value: **900**.
*   If **ListenerProtocol** is set to **UDP**, this parameter can be set to a value ranging from **10** to **20**. Default value: **20**.', example='900'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcp_80'),
  listenerPort?: int32(name='ListenerPort', description='The listener port. Valid values: **0** to **65535**.

If you set this parameter to **0**, the listener listens by port range. If you set this parameter to **0**, you must also set the **StartPort** and **EndPort** parameters.

This parameter is required.', example='80'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.

This parameter is required.', example='TCP'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  mss?: int32(name='Mss', description='The size of the largest TCP packet segment. Unit: bytes. Valid values: **0** to **1500**. **0** indicates that the maximum segment size (MSS) value of TCP packets remains unchanged.

>  This parameter takes effect only for TCP and TCPSSL listeners.', example='43'),
  proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Specifies whether to use the Proxy protocol to pass client IP addresses to backend servers. Valid values:

*   **true**
*   **false** (default)', example='false'),
  proxyProtocolV2Config?: {
    ppv2PrivateLinkEpIdEnabled?: boolean(name='Ppv2PrivateLinkEpIdEnabled', description='Specifies whether to use the Proxy protocol to pass the Ppv2PrivateLinkEpId parameter to backend servers. Valid values:

*   **true**
*   **false** (default)', example='false'),
    ppv2PrivateLinkEpsIdEnabled?: boolean(name='Ppv2PrivateLinkEpsIdEnabled', description='Specifies whether to use the Proxy protocol to pass the PrivateLinkEpsId parameter to backend servers. Valid values:

*   **true**
*   **false** (default)', example='false'),
    ppv2VpcIdEnabled?: boolean(name='Ppv2VpcIdEnabled', description='Specifies whether to use the Proxy protocol to pass the VpcId parameter to backend servers. Valid values:

*   **true**
*   **false** (default)', example='false'),
  }(name='ProxyProtocolV2Config', description='Specifies whether to use the Proxy protocol to pass the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  secSensorEnabled?: boolean(name='SecSensorEnabled', description='Specifies whether to enable fine-grained monitoring. Valid values:

*   **true**
*   **false** (default)', example='false'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. System security policies and custom security policies are supported.

*   Valid values for system security policies: **tls_cipher_policy_1_0** (default), **tls_cipher_policy_1_1**, **tls_cipher_policy_1_2**, **tls_cipher_policy_1_2_strict**, and **tls_cipher_policy_1_2_strict_with_1_3**.

*   For a custom security policy, enter the policy ID.

    *   For information about creating a custom security policy, see [CreateSecurityPolicy](https://help.aliyun.com/document_detail/445901.html).
    *   For information about querying security policies, see [ListSecurityPolicy](https://help.aliyun.com/document_detail/445900.html).

>  This parameter takes effect only for TCPSSL listeners.', example='tls_cipher_policy_1_0'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

>  *   If you set **ListenerProtocol** to **TCP**, you can associate the listener with server groups whose backend protocol is **TCP** or **TCP_UDP**. You cannot associate the listener with server groups whose backend protocol is **UDP**.
>  *   If you set **ListenerProtocol** to **UDP**, you can associate the listener with server groups whose backend protocol is **UDP** or **TCP_UDP**. You cannot associate the listener with server groups whose backend protocol is **TCP**.
>  *   If you set **ListenerProtocol** to **TCPSSL**, you can associate the listener with server groups whose backend protocol is **TCP** and have **client IP preservation disabled**. You cannot associate the listener with server groups whose backend protocol is **TCP** and have **client IP preservation enabled** or server groups whose backend protocol is **UDP** or **TCP_UDP**.

This parameter is required.', example='sgp-ppdpc14gdm3x4o****'),
  startPort?: int32(name='StartPort', description='The first port in the listener port range. Valid values: **0** to **65535**.

>  This parameter is required when **ListenerPort** is set to **0**.', example='244'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='KeyTest'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='Test'),
    }
  ](name='Tag', description='The tags.', nullable=true),
}

model CreateListenerShrinkRequest {
  alpnEnabled?: boolean(name='AlpnEnabled', description='Specifies whether to enable Application-Layer Protocol Negotiation (ALPN). Valid values:

*   **true**
*   **false** (default)', example='false'),
  alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**: uses only HTTP 1.x. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0.
*   **HTTP2Only**: uses only HTTP 2.0.
*   **HTTP2Optional**: preferentially uses HTTP 1.x over HTTP 2.0. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0, and the priority of HTTP 1.0 is higher than the priority of HTTP 2.0.
*   **HTTP2Preferred**: preferentially uses HTTP 2.0 over HTTP 1.x. The priority of HTTP 2.0 is higher than the priority of HTTP 1.1, and the priority of HTTP 1.1 is higher than the priority of HTTP 1.0.

>  This parameter is required if **AlpnEnabled** is set to true.', example='HTTP1Only'),
  caCertificateIds?: [ string ](name='CaCertificateIds', description='The certificate authority (CA) certificate. This parameter is supported only by TCLSSL listeners.

>  You can specify only one CA certificate.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**
*   **false** (default)', example='false'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificate. This parameter is supported only by TCLSSL listeners.

>  You can specify only one server certificate.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='100'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  endPort?: int32(name='EndPort', description='The last port in the listener port range. Valid values: **0** to **65535**. The port number of the last port must be greater than the port number of the first port.

>  This parameter is required when **ListenerPort** is set to **0**.', example='566'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period for idle connections. Unit: seconds.

*   If you set **ListenerProtocol** to **TCP** or **TCPSSL**, this parameter can be set to a value ranging from **10** to **900**. Default value: **900**.
*   If **ListenerProtocol** is set to **UDP**, this parameter can be set to a value ranging from **10** to **20**. Default value: **20**.', example='900'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcp_80'),
  listenerPort?: int32(name='ListenerPort', description='The listener port. Valid values: **0** to **65535**.

If you set this parameter to **0**, the listener listens by port range. If you set this parameter to **0**, you must also set the **StartPort** and **EndPort** parameters.

This parameter is required.', example='80'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.

This parameter is required.', example='TCP'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  mss?: int32(name='Mss', description='The size of the largest TCP packet segment. Unit: bytes. Valid values: **0** to **1500**. **0** indicates that the maximum segment size (MSS) value of TCP packets remains unchanged.

>  This parameter takes effect only for TCP and TCPSSL listeners.', example='43'),
  proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Specifies whether to use the Proxy protocol to pass client IP addresses to backend servers. Valid values:

*   **true**
*   **false** (default)', example='false'),
  proxyProtocolV2ConfigShrink?: string(name='ProxyProtocolV2Config', description='Specifies whether to use the Proxy protocol to pass the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  secSensorEnabled?: boolean(name='SecSensorEnabled', description='Specifies whether to enable fine-grained monitoring. Valid values:

*   **true**
*   **false** (default)', example='false'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. System security policies and custom security policies are supported.

*   Valid values for system security policies: **tls_cipher_policy_1_0** (default), **tls_cipher_policy_1_1**, **tls_cipher_policy_1_2**, **tls_cipher_policy_1_2_strict**, and **tls_cipher_policy_1_2_strict_with_1_3**.

*   For a custom security policy, enter the policy ID.

    *   For information about creating a custom security policy, see [CreateSecurityPolicy](https://help.aliyun.com/document_detail/445901.html).
    *   For information about querying security policies, see [ListSecurityPolicy](https://help.aliyun.com/document_detail/445900.html).

>  This parameter takes effect only for TCPSSL listeners.', example='tls_cipher_policy_1_0'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

>  *   If you set **ListenerProtocol** to **TCP**, you can associate the listener with server groups whose backend protocol is **TCP** or **TCP_UDP**. You cannot associate the listener with server groups whose backend protocol is **UDP**.
>  *   If you set **ListenerProtocol** to **UDP**, you can associate the listener with server groups whose backend protocol is **UDP** or **TCP_UDP**. You cannot associate the listener with server groups whose backend protocol is **TCP**.
>  *   If you set **ListenerProtocol** to **TCPSSL**, you can associate the listener with server groups whose backend protocol is **TCP** and have **client IP preservation disabled**. You cannot associate the listener with server groups whose backend protocol is **TCP** and have **client IP preservation enabled** or server groups whose backend protocol is **UDP** or **TCP_UDP**.

This parameter is required.', example='sgp-ppdpc14gdm3x4o****'),
  startPort?: int32(name='StartPort', description='The first port in the listener port range. Valid values: **0** to **65535**.

>  This parameter is required when **ListenerPort** is set to **0**.', example='244'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='KeyTest'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='Test'),
    }
  ](name='Tag', description='The tags.', nullable=true),
}

model CreateListenerResponseBody = {
  jobId?: string(name='JobId', description='The asynchronous task ID.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  listenerId?: string(name='ListenerId', description='The listener ID.', example='lsn-bp1bpn0kn908w4nbw****@80'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateListenerResponseBody(name='body'),
}

/**
 * @summary Creates a TCP or UDP listener, or a listener that uses SSL over TCP for a Network Load Balancer (NLB) instance.
 *
 * @param tmpReq CreateListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateListenerResponse
 */
async function createListenerWithOptions(tmpReq: CreateListenerRequest, runtime: $RuntimeOptions): CreateListenerResponse {
  tmpReq.validate();
  var request = new CreateListenerShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.proxyProtocolV2Config)) {
    request.proxyProtocolV2ConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.proxyProtocolV2Config, 'ProxyProtocolV2Config', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.alpnEnabled)) {
    body['AlpnEnabled'] = request.alpnEnabled;
  }
  if (!$isNull(request.alpnPolicy)) {
    body['AlpnPolicy'] = request.alpnPolicy;
  }
  if (!$isNull(request.caCertificateIds)) {
    body['CaCertificateIds'] = request.caCertificateIds;
  }
  if (!$isNull(request.caEnabled)) {
    body['CaEnabled'] = request.caEnabled;
  }
  if (!$isNull(request.certificateIds)) {
    body['CertificateIds'] = request.certificateIds;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.cps)) {
    body['Cps'] = request.cps;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.endPort)) {
    body['EndPort'] = request.endPort;
  }
  if (!$isNull(request.idleTimeout)) {
    body['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.listenerDescription)) {
    body['ListenerDescription'] = request.listenerDescription;
  }
  if (!$isNull(request.listenerPort)) {
    body['ListenerPort'] = request.listenerPort;
  }
  if (!$isNull(request.listenerProtocol)) {
    body['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.mss)) {
    body['Mss'] = request.mss;
  }
  if (!$isNull(request.proxyProtocolEnabled)) {
    body['ProxyProtocolEnabled'] = request.proxyProtocolEnabled;
  }
  if (!$isNull(request.proxyProtocolV2ConfigShrink)) {
    body['ProxyProtocolV2Config'] = request.proxyProtocolV2ConfigShrink;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.secSensorEnabled)) {
    body['SecSensorEnabled'] = request.secSensorEnabled;
  }
  if (!$isNull(request.securityPolicyId)) {
    body['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.startPort)) {
    body['StartPort'] = request.startPort;
  }
  if (!$isNull(request.tag)) {
    body['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a TCP or UDP listener, or a listener that uses SSL over TCP for a Network Load Balancer (NLB) instance.
 *
 * @param request CreateListenerRequest
 * @return CreateListenerResponse
 */
async function createListener(request: CreateListenerRequest): CreateListenerResponse {
  var runtime = new $RuntimeOptions{};
  return createListenerWithOptions(request, runtime);
}

model CreateLoadBalancerRequest {
  addressIpVersion?: string(name='AddressIpVersion', description='The IP version of the NLB instance. Valid values:

*   **ipv4** (default): IPv4
*   **DualStack**: dual-stack', example='ipv4'),
  addressType?: string(name='AddressType', description='The type of the IPv4 address used by the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the instance is resolved to the public IP address. The instance is accessible over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the instance is resolved to the private IP address. The instance is accessible only within the virtual private cloud (VPC) where the instance is deployed.

>  To enable a public IPv6 address for a dual-stack NLB instance, call the [EnableLoadBalancerIpv6Internet](https://help.aliyun.com/document_detail/445878.html) operation.

This parameter is required.', example='Internet'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the Internet Shared Bandwidth instance that is associated with the Internet-facing NLB instance.', example='cbwp-bp1vevu8h3ieh****'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  deletionProtectionConfig?: {
    enabled?: boolean(name='Enabled', description='Specifies whether to enable the deletion protection feature. Valid values:

*   **true**
*   **false** (default)', example='false'),
    reason?: string(name='Reason', description='The reason why the deletion protection feature is enabled or disabled. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.', example='The instance is running'),
  }(name='DeletionProtectionConfig', description='The configuration of the deletion protection feature.'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerBillingConfig?: {
    payType?: string(name='PayType', description='The billing method of the NLB instance.

Set the value to **PostPay**, which specifies the pay-as-you-go billing method.', example='PostPay'),
  }(name='LoadBalancerBillingConfig', description='The billing settings of the NLB instance.'),
  loadBalancerName?: string(name='LoadBalancerName', description='The name of the NLB instance.

It must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.', example='NLB1'),
  loadBalancerType?: string(name='LoadBalancerType', description='The type of the Server Load Balancer (SLB) instance. Set the value to **network**, which specifies NLB.', example='network'),
  modificationProtectionConfig?: {
    reason?: string(name='Reason', description='The reason for enabling the configuration read-only mode. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.

>  This parameter takes effect only when **Status** is set to **ConsoleProtection**.', example='Service guarantee period'),
    status?: string(name='Status', description='Specifies whether to enable the configuration read-only mode. Valid values:

*   **NonProtection**: does not enable the configuration read-only mode. You cannot set the **Reason** parameter. If the **Reason** parameter is set, the value is cleared.
*   **ConsoleProtection**: enables the configuration read-only mode. You can set the **Reason** parameter.

>  If the parameter is set to **ConsoleProtection**, the configuration read-only mode is enabled. You cannot modify the configurations of the NLB instance in the NLB console. However, you can call API operations to modify the configurations of the NLB instance.', example='ConsoleProtection'),
  }(name='ModificationProtectionConfig', description='The configuration of the configuration read-only mode.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-atstuj3rtop****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. The tag key can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='env'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='product'),
    }
  ](name='Tag', description='The tags.', nullable=true),
  vpcId?: string(name='VpcId', description='The ID of the VPC where you want to create the NLB instance.

This parameter is required.', example='vpc-bp1b49rqrybk45nio****'),
  zoneMappings?: [ 
    {
      allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP) that is associated with the Internet-facing NLB instance. Each zone is assigned one EIP. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, specify at least two zones.', example='eip-bp1aedxso6u80u0qf****'),
      ipv4LocalAddresses?: [ string ](name='Ipv4LocalAddresses', description='The local IPv4 addresses. The IP addresses that the NLB instance uses to communicate with the backend servers. The number of IP addresses must be an even number, which must be at least 2 and at most 8.'),
      ipv6Address?: string(name='Ipv6Address', description='The VIP of the IPv6 version. The IPv6 address that the NLB instance uses to provide external services.', example='2408:400a:d5:3080:b409:840a:ca:e8e5'),
      ipv6LocalAddresses?: [ string ](name='Ipv6LocalAddresses', description='The local IPv6 addresses. The IP addresses that the NLB instance uses to communicate with the backend servers. The number of IP addresses must be an even number, which must be at least 2 and at most 8.'),
      privateIPv4Address?: string(name='PrivateIPv4Address', description='The private virtual IP address (VIP) of the IPv4 version. The private IPv4 address that the NLB instance uses to provide external services.', example='192.168.10.1'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an NLB instance. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, you must specify at least two zones.

This parameter is required.', example='vsw-sersdf****'),
      zoneId?: string(name='ZoneId', description='The ID of the zone where the NLB instance is deployed. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, specify at least two zones.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches. An NLB instance can be deployed in up to 10 zones. If the region supports two or more zones, you must specify at least two zones.

This parameter is required.'),
}

model CreateLoadBalancerResponseBody = {
  loadbalancerId?: string(name='LoadbalancerId', description='The ID of the NLB instance.', example='nlb-83ckzc8d4xlp8o****'),
  orderId?: long(name='OrderId', description='The ID of the order for the NLB instance.', example='20230000'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model CreateLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Creates a Network Load Balancer (NLB) instance in a specified region.
 *
 * @description *   When you create an NLB instance, the service-linked role AliyunServiceRoleForNlb is automatically created and assigned to you.
 * *   **CreateLoadBalancer** is an asynchronous operation. After you send a request, the system returns an instance ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) to query the status of an NLB instance.
 *     *   If an NLB instance is in the **Provisioning** state, the NLB instance is being created.
 *     *   If an NLB instance is in the **Active** state, the NLB instance is created.
 *
 * @param request CreateLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateLoadBalancerResponse
 */
async function createLoadBalancerWithOptions(request: CreateLoadBalancerRequest, runtime: $RuntimeOptions): CreateLoadBalancerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.addressIpVersion)) {
    body['AddressIpVersion'] = request.addressIpVersion;
  }
  if (!$isNull(request.addressType)) {
    body['AddressType'] = request.addressType;
  }
  if (!$isNull(request.bandwidthPackageId)) {
    body['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.deletionProtectionConfig)) {
    bodyFlat['DeletionProtectionConfig'] = request.deletionProtectionConfig;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerBillingConfig)) {
    bodyFlat['LoadBalancerBillingConfig'] = request.loadBalancerBillingConfig;
  }
  if (!$isNull(request.loadBalancerName)) {
    body['LoadBalancerName'] = request.loadBalancerName;
  }
  if (!$isNull(request.loadBalancerType)) {
    body['LoadBalancerType'] = request.loadBalancerType;
  }
  if (!$isNull(request.modificationProtectionConfig)) {
    bodyFlat['ModificationProtectionConfig'] = request.modificationProtectionConfig;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    body['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  if (!$isNull(request.zoneMappings)) {
    bodyFlat['ZoneMappings'] = request.zoneMappings;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateLoadBalancer',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a Network Load Balancer (NLB) instance in a specified region.
 *
 * @description *   When you create an NLB instance, the service-linked role AliyunServiceRoleForNlb is automatically created and assigned to you.
 * *   **CreateLoadBalancer** is an asynchronous operation. After you send a request, the system returns an instance ID and runs the task in the background. You can call [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) to query the status of an NLB instance.
 *     *   If an NLB instance is in the **Provisioning** state, the NLB instance is being created.
 *     *   If an NLB instance is in the **Active** state, the NLB instance is created.
 *
 * @param request CreateLoadBalancerRequest
 * @return CreateLoadBalancerResponse
 */
async function createLoadBalancer(request: CreateLoadBalancerRequest): CreateLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return createLoadBalancerWithOptions(request, runtime);
}

model CreateSecurityPolicyRequest {
  ciphers?: [ string ](name='Ciphers', description='The cipher suites supported by the security policy. Valid values of this parameter vary based on TlsVersions. A security policy supports up to 32 cipher suites.

TLSv1.0 and TLSv1.1 support the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**

TLSv1.2 supports the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**
*   **ECDHE-ECDSA-AES128-GCM-SHA256**
*   **ECDHE-ECDSA-AES256-GCM-SHA384**
*   **ECDHE-ECDSA-AES128-SHA256**
*   **ECDHE-ECDSA-AES256-SHA384**
*   **ECDHE-RSA-AES128-GCM-SHA256**
*   **ECDHE-RSA-AES256-GCM-SHA384**
*   **ECDHE-RSA-AES128-SHA256**
*   **ECDHE-RSA-AES256-SHA384**
*   **AES128-GCM-SHA256**
*   **AES256-GCM-SHA384**
*   **AES128-SHA256**
*   **AES256-SHA256**

TLSv1.3 supports the following cipher suites:

*   **TLS_AES_128_GCM_SHA256**
*   **TLS_AES_256_GCM_SHA384**
*   **TLS_CHACHA20_POLY1305_SHA256**
*   **TLS_AES_128_CCM_SHA256**
*   **TLS_AES_128_CCM_8_SHA256**

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the security policy belongs.', example='rg-atstuj3rtop****'),
  securityPolicyName?: string(name='SecurityPolicyName', description='The name of the security policy.

It must be 1 to 200 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).', example='TLSCipherPolicy'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. It must be 1 to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. It can contain letters, digits, underscores (_), periods (.), colons (:), forward slashes (/), equal signs (=), plus signs (+), minus signs (-), and at signs (@).

You can add up to 20 tags for the security policy in each call.', example='KeyTest'),
      value?: string(name='Value', description='The value of the tag. It must be 1 to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. It can contain letters, digits, underscores (_), periods (.), colons (:), forward slashes (/), equal signs (=), plus signs (+), minus signs (-), and at signs (@).

You can add up to 20 tags for the security policy in each call.', example='ValueTest'),
    }
  ](name='Tag', description='The tags.', nullable=true),
  tlsVersions?: [ string ](name='TlsVersions', description='The Transport Layer Security (TLS) versions supported by the security policy. Valid values: **TLSv1.0**, **TLSv1.1**, **TLSv1.2**, and **TLSv1.3**.

This parameter is required.'),
}

model CreateSecurityPolicyResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='D7A8875F-373A-5F48-8484-25B07A61F2AF'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.', example='tls-bp14bb1e7dll4f****'),
}

model CreateSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Creates a custom security policy for a TCP/SSL listener.
 *
 * @param request CreateSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateSecurityPolicyResponse
 */
async function createSecurityPolicyWithOptions(request: CreateSecurityPolicyRequest, runtime: $RuntimeOptions): CreateSecurityPolicyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.ciphers)) {
    body['Ciphers'] = request.ciphers;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityPolicyName)) {
    body['SecurityPolicyName'] = request.securityPolicyName;
  }
  if (!$isNull(request.tag)) {
    body['Tag'] = request.tag;
  }
  if (!$isNull(request.tlsVersions)) {
    body['TlsVersions'] = request.tlsVersions;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateSecurityPolicy',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a custom security policy for a TCP/SSL listener.
 *
 * @param request CreateSecurityPolicyRequest
 * @return CreateSecurityPolicyResponse
 */
async function createSecurityPolicy(request: CreateSecurityPolicyRequest): CreateSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return createSecurityPolicyWithOptions(request, runtime);
}

model CreateServerGroupRequest {
  addressIPVersion?: string(name='AddressIPVersion', description='The IP version. Valid values:

*   **ipv4** (default): IPv4
*   **DualStack**: dual-stack', example='ipv4'),
  anyPortEnabled?: boolean(name='AnyPortEnabled', description='Specifies whether to enable multi-port forwarding. Valid values:

*   **true:**
*   **false** (default)', example='false'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Specifies whether to enable connection draining. Valid values:

*   **true:**
*   **false** (default)', example='false'),
  connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='Specifies a timeout period for connection draining. Unit: seconds Valid values: **0** to **900**.', example='10'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true:**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  healthCheckConfig?: {
    healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The port that you want to use for health checks on backend servers.

Valid values: **0** to **65535**.

Default value: **0**. If you set this parameter to 0, the port that the backend server uses to provide services is also used for health checks.', example='0'),
    healthCheckConnectTimeout?: int32(name='HealthCheckConnectTimeout', description='The timeout period for a health check response. Unit: seconds Valid values: **1** to **300** Default value: **5**.', example='5'),
    healthCheckDomain?: string(name='HealthCheckDomain', description='The domain name that is used for health checks. Valid values:

*   **$SERVER_IP**: the internal IP address of a backend server.
*   **domain**: a domain name. The domain name must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), and periods (.).

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='$SERVER_IP'),
    healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable health checks. Valid values:

*   **true** (default)
*   **false**', example='true'),
    healthCheckExp?: string(name='HealthCheckExp', description='The response string that backend servers return to UDP listeners for health checks. The string must be 1 to 512 characters in length and can contain only letters and digits.', example='ok'),
    healthCheckHttpCode?: [ string ](name='HealthCheckHttpCode', description='The HTTP status codes to return for health checks. Separate multiple HTTP status codes with commas (,). Valid values: **http_2xx** (default), **http_3xx**, **http_4xx**, and **http_5xx**.

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.'),
    healthCheckHttpVersion?: string(name='HealthCheckHttpVersion', example='HTTP1.0'),
    healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds Default value: **5**

*   If you set **HealthCheckType** to **TCP** or **HTTP**, valid values are **1** to **50**.
*   If you set **HealthCheckType** to **UDP**, valid values are **1** to **300**. Set the health check interval equal to or larger than the response timeout period to ensure that UDP response timeouts are not determined as no responses.', example='5'),
    healthCheckReq?: string(name='HealthCheckReq', description='The request string that UDP listeners send to backend servers for health checks. The string must be 1 to 512 characters in length and can contain only letters and digits.', example='hello'),
    healthCheckType?: string(name='HealthCheckType', description='The protocol that you want to use for health checks. Valid values:

*   **TCP**
*   **HTTP**
*   **UDP**', example='TCP'),
    healthCheckUrl?: string(name='HealthCheckUrl', description='The URL path to which health check probes are sent.

The URL path must be 1 to 80 characters in length, and can contain letters, digits, and the following special characters: ` - / . % ? # &  `. It must start with a forward slash (/).

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='/test/index.html'),
    healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from **fail** to **success**.

Valid values: **2** to **10**

Default value: **2**', example='2'),
    httpCheckMethod?: string(name='HttpCheckMethod', description='The HTTP method that is used for health checks. Valid values: **GET** (default) and **HEAD**.

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='GET'),
    unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from **success** to **fail**.

Valid values: **2** to **10**

Default value: **2**', example='2'),
  }(name='HealthCheckConfig', description='The configurations of health checks.'),
  preserveClientIpEnabled?: boolean(name='PreserveClientIpEnabled', description='Specifies whether to enable client IP preservation. Valid values:

*   **true** (default)
*   **false**

>  If you set this parameter to **true** and **Protocol** to **TCP**, the server group cannot be associated with **TCPSSL** listeners.', example='true', nullable=false),
  protocol?: string(name='Protocol', description='The protocol between the NLB instance and backend servers. Valid values:

*   **TCP** (default)
*   **UDP**
*   **TCP_UDP**

> *   If you set this parameter to **UDP**, you can associate the server group only with **UDP** listeners.
> *   If you set this parameter to **TCP** and **PreserveClientIpEnabled** to **true**, you can associate the server group only with **TCP** listeners.
> *   If you set this parameter to **TCP** and **PreserveClientIpEnabled** to **false**, you can associate the server group with **TCPSSL** and **TCP** listeners.
> *   If you set this parameter to **TCP_UDP**, you can associate the server group with **TCP** and **UDP** listeners.', example='TCP'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the server group belongs.', example='rg-atstuj3rtop****'),
  scheduler?: string(name='Scheduler', description='The scheduling algorithm. Valid values:

*   **Wrr** (default): weighted round-robin. Backend servers with higher weights receive more requests.
*   **Wlc**: weighted least connections. Requests are distributed based on the weights and the number of connections to backend servers. If multiple backend servers have the same weight, requests are forwarded to the backend server with the least connections.
*   **rr**: Requests are forwarded to backend servers in sequence.
*   **sch**: source IP hash. Requests from the same source IP address are forwarded to the same backend server.
*   **tch**: consistent hashing based on four factors: source IP address, destination IP address, source port, and destination port. Requests that contain the same four factors are forwarded to the same backend server.
*   **qch**: QUIC ID hash. Requests that contain the same QUIC ID are forwarded to the same backend server.

>  QUIC ID hash is supported only when the backend protocol is set to UDP.', example='Wrr'),
  serverGroupName?: string(name='ServerGroupName', description='The server group name.

The name must be 2 to 128 characters in length, can contain digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.

This parameter is required.', example='NLB_ServerGroup'),
  serverGroupType?: string(name='ServerGroupType', description='The type of the server group. Valid values:

*   **Instance** (default): allows you to specify servers of the **Ecs**, **Eni**, or **Eci** type.
*   **Ip**: allows you to specify IP addresses.', example='Instance'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. The tag key can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='env'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='product'),
    }
  ](name='Tag', description='The tags.', nullable=true),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) where the server group is deployed.

>  If **ServerGroupType** is set to **Instance**, only servers in the specified VPC can be added to the server group.

This parameter is required.', example='vpc-bp15zckdt37pq72zv****'),
}

model CreateServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-atstuj3rtoptyui****'),
}

model CreateServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateServerGroupResponseBody(name='body'),
}

/**
 * @summary Creates a server group in a region.
 *
 * @description **CreateServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the creation status of the task.
 *    - If the task is in the **Succeeded** status, the server group is created.
 * -    If the task is in the **Processing** status, the server group is being created.
 *
 * @param request CreateServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateServerGroupResponse
 */
async function createServerGroupWithOptions(request: CreateServerGroupRequest, runtime: $RuntimeOptions): CreateServerGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.addressIPVersion)) {
    body['AddressIPVersion'] = request.addressIPVersion;
  }
  if (!$isNull(request.anyPortEnabled)) {
    body['AnyPortEnabled'] = request.anyPortEnabled;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.connectionDrainEnabled)) {
    body['ConnectionDrainEnabled'] = request.connectionDrainEnabled;
  }
  if (!$isNull(request.connectionDrainTimeout)) {
    body['ConnectionDrainTimeout'] = request.connectionDrainTimeout;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.healthCheckConfig)) {
    bodyFlat['HealthCheckConfig'] = request.healthCheckConfig;
  }
  if (!$isNull(request.preserveClientIpEnabled)) {
    body['PreserveClientIpEnabled'] = request.preserveClientIpEnabled;
  }
  if (!$isNull(request.protocol)) {
    body['Protocol'] = request.protocol;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.scheduler)) {
    body['Scheduler'] = request.scheduler;
  }
  if (!$isNull(request.serverGroupName)) {
    body['ServerGroupName'] = request.serverGroupName;
  }
  if (!$isNull(request.serverGroupType)) {
    body['ServerGroupType'] = request.serverGroupType;
  }
  if (!$isNull(request.tag)) {
    body['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateServerGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Creates a server group in a region.
 *
 * @description **CreateServerGroup** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the creation status of the task.
 *    - If the task is in the **Succeeded** status, the server group is created.
 * -    If the task is in the **Processing** status, the server group is being created.
 *
 * @param request CreateServerGroupRequest
 * @return CreateServerGroupResponse
 */
async function createServerGroup(request: CreateServerGroupRequest): CreateServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return createServerGroupWithOptions(request, runtime);
}

model DeleteListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DeleteListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DeleteListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteListenerResponseBody(name='body'),
}

/**
 * @summary Deletes a Network Load Balancer (NLB) listener.
 *
 * @param request DeleteListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteListenerResponse
 */
async function deleteListenerWithOptions(request: DeleteListenerRequest, runtime: $RuntimeOptions): DeleteListenerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a Network Load Balancer (NLB) listener.
 *
 * @param request DeleteListenerRequest
 * @return DeleteListenerResponse
 */
async function deleteListener(request: DeleteListenerRequest): DeleteListenerResponse {
  var runtime = new $RuntimeOptions{};
  return deleteListenerWithOptions(request, runtime);
}

model DeleteLoadBalancerRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-wb7r6dlwetvt5j****'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DeleteLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DeleteLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Deletes a Network Load Balancer (NLB) instance.
 *
 * @param request DeleteLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteLoadBalancerResponse
 */
async function deleteLoadBalancerWithOptions(request: DeleteLoadBalancerRequest, runtime: $RuntimeOptions): DeleteLoadBalancerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteLoadBalancer',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a Network Load Balancer (NLB) instance.
 *
 * @param request DeleteLoadBalancerRequest
 * @return DeleteLoadBalancerResponse
 */
async function deleteLoadBalancer(request: DeleteLoadBalancerRequest): DeleteLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return deleteLoadBalancerWithOptions(request, runtime);
}

model DeleteSecurityPolicyRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.

This parameter is required.', example='tls-bp14bb1e7dll4f****'),
}

model DeleteSecurityPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='D7A8875F-373A-5F48-8484-25B07A61F2AF'),
}

model DeleteSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Deletes a custom TLS security policy from a Network Load Balancer (NLB) instance.
 *
 * @param request DeleteSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteSecurityPolicyResponse
 */
async function deleteSecurityPolicyWithOptions(request: DeleteSecurityPolicyRequest, runtime: $RuntimeOptions): DeleteSecurityPolicyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityPolicyId)) {
    body['SecurityPolicyId'] = request.securityPolicyId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteSecurityPolicy',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a custom TLS security policy from a Network Load Balancer (NLB) instance.
 *
 * @param request DeleteSecurityPolicyRequest
 * @return DeleteSecurityPolicyResponse
 */
async function deleteSecurityPolicy(request: DeleteSecurityPolicyRequest): DeleteSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return deleteSecurityPolicyWithOptions(request, runtime);
}

model DeleteServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtoptyui****'),
}

model DeleteServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DeleteServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteServerGroupResponseBody(name='body'),
}

/**
 * @summary Deletes a Network Load Balancer (NLB) server group.
 *
 * @description You can delete server groups that are not associated with listeners.
 *
 * @param request DeleteServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteServerGroupResponse
 */
async function deleteServerGroupWithOptions(request: DeleteServerGroupRequest, runtime: $RuntimeOptions): DeleteServerGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteServerGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes a Network Load Balancer (NLB) server group.
 *
 * @description You can delete server groups that are not associated with listeners.
 *
 * @param request DeleteServerGroupRequest
 * @return DeleteServerGroupResponse
 */
async function deleteServerGroup(request: DeleteServerGroupRequest): DeleteServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return deleteServerGroupWithOptions(request, runtime);
}

model DescribeHdMonitorRegionConfigRequest {
  regionId?: string(name='RegionId', description='The ID of the region where the resources are deployed.', example='cn-hangzhou'),
}

model DescribeHdMonitorRegionConfigResponseBody = {
  logProject?: string(name='LogProject', description='The name of the Log Service project.', example='hdmonitor-cn-hangzhou-223794579283657556'),
  metricStore?: string(name='MetricStore', description='The name of the Metricstore in Simple Log Service.', example='hdmonitor-cn-hangzhou-metricStore-1'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to obtain the region ID.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model DescribeHdMonitorRegionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHdMonitorRegionConfigResponseBody(name='body'),
}

/**
 * @summary Queries the storage configurations of fine-grained monitoring.
 *
 * @param request DescribeHdMonitorRegionConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHdMonitorRegionConfigResponse
 */
async function describeHdMonitorRegionConfigWithOptions(request: DescribeHdMonitorRegionConfigRequest, runtime: $RuntimeOptions): DescribeHdMonitorRegionConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeHdMonitorRegionConfig',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the storage configurations of fine-grained monitoring.
 *
 * @param request DescribeHdMonitorRegionConfigRequest
 * @return DescribeHdMonitorRegionConfigResponse
 */
async function describeHdMonitorRegionConfig(request: DescribeHdMonitorRegionConfigRequest): DescribeHdMonitorRegionConfigResponse {
  var runtime = new $RuntimeOptions{};
  return describeHdMonitorRegionConfigWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported natural language. Valid values:

*   **zh-CN**: Chinese
*   **en-US** (default): English
*   **ja**: Japanese', example='en-US'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  serviceCode?: string(name='ServiceCode', description='The service code. Set the value to **nlb**.', example='nlb'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='us-east-1'),
      regionEndpoint?: string(name='RegionEndpoint', description='The endpoint of the region service.', example='nlb.cn-hangzhou.aliyuncs.com'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-hangzhou'),
    }
  ](name='Regions', description='A list of regions.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary Queries regions that support Network Load Balancer (NLB) instances.
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: $RuntimeOptions): DescribeRegionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeRegions',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries regions that support Network Load Balancer (NLB) instances.
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new $RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeZonesRequest {
  acceptLanguage?: string(name='AcceptLanguage', description='The supported natural language. Valid values:

*   **zh-CN**: Chinese
*   **en-US** (default): English
*   **ja**: Japanese', example='zh-CN'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  regionId?: string(name='RegionId', description='The ID of the region to which the zone belongs. You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serviceCode?: string(name='ServiceCode', description='The service code. Set the value to **nlb**.', example='nlb'),
}

model DescribeZonesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  zones?: [ 
    {
      localName?: string(name='LocalName', description='The zone name.', example='ap_southeast_2'),
      zoneId?: string(name='ZoneId', description='The zone ID.', example='cn-hangzhou-g'),
    }
  ](name='Zones', description='A list of zones.'),
}

model DescribeZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeZonesResponseBody(name='body'),
}

/**
 * @summary Queries the zones of a region in which a Network Load Balancer (NLB) instance is deployed.
 *
 * @param request DescribeZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeZonesResponse
 */
async function describeZonesWithOptions(request: DescribeZonesRequest, runtime: $RuntimeOptions): DescribeZonesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.acceptLanguage)) {
    query['AcceptLanguage'] = request.acceptLanguage;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeZones',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the zones of a region in which a Network Load Balancer (NLB) instance is deployed.
 *
 * @param request DescribeZonesRequest
 * @return DescribeZonesResponse
 */
async function describeZones(request: DescribeZonesRequest): DescribeZonesResponse {
  var runtime = new $RuntimeOptions{};
  return describeZonesWithOptions(request, runtime);
}

model DetachCommonBandwidthPackageFromLoadBalancerRequest {
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the Internet Shared Bandwidth instance.

This parameter is required.', example='cbwp-bp1pzf0ym72pu3y76****'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DetachCommonBandwidthPackageFromLoadBalancerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DetachCommonBandwidthPackageFromLoadBalancerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachCommonBandwidthPackageFromLoadBalancerResponseBody(name='body'),
}

/**
 * @summary Disassociates a Network Load Balancer (NLB) instance from an Internet Shared Bandwidth instance.
 *
 * @param request DetachCommonBandwidthPackageFromLoadBalancerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachCommonBandwidthPackageFromLoadBalancerResponse
 */
async function detachCommonBandwidthPackageFromLoadBalancerWithOptions(request: DetachCommonBandwidthPackageFromLoadBalancerRequest, runtime: $RuntimeOptions): DetachCommonBandwidthPackageFromLoadBalancerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.bandwidthPackageId)) {
    body['BandwidthPackageId'] = request.bandwidthPackageId;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetachCommonBandwidthPackageFromLoadBalancer',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates a Network Load Balancer (NLB) instance from an Internet Shared Bandwidth instance.
 *
 * @param request DetachCommonBandwidthPackageFromLoadBalancerRequest
 * @return DetachCommonBandwidthPackageFromLoadBalancerResponse
 */
async function detachCommonBandwidthPackageFromLoadBalancer(request: DetachCommonBandwidthPackageFromLoadBalancerRequest): DetachCommonBandwidthPackageFromLoadBalancerResponse {
  var runtime = new $RuntimeOptions{};
  return detachCommonBandwidthPackageFromLoadBalancerWithOptions(request, runtime);
}

model DisableLoadBalancerIpv6InternetRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DisableLoadBalancerIpv6InternetResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model DisableLoadBalancerIpv6InternetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisableLoadBalancerIpv6InternetResponseBody(name='body'),
}

/**
 * @summary Changes the public IPv6 address of a dual-stack Network Load Balancer (NLB) instance to a private IPv6 address.
 *
 * @param request DisableLoadBalancerIpv6InternetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisableLoadBalancerIpv6InternetResponse
 */
async function disableLoadBalancerIpv6InternetWithOptions(request: DisableLoadBalancerIpv6InternetRequest, runtime: $RuntimeOptions): DisableLoadBalancerIpv6InternetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisableLoadBalancerIpv6Internet',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the public IPv6 address of a dual-stack Network Load Balancer (NLB) instance to a private IPv6 address.
 *
 * @param request DisableLoadBalancerIpv6InternetRequest
 * @return DisableLoadBalancerIpv6InternetResponse
 */
async function disableLoadBalancerIpv6Internet(request: DisableLoadBalancerIpv6InternetRequest): DisableLoadBalancerIpv6InternetResponse {
  var runtime = new $RuntimeOptions{};
  return disableLoadBalancerIpv6InternetWithOptions(request, runtime);
}

model DisassociateAdditionalCertificatesWithListenerRequest {
  additionalCertificateIds?: [ string ](name='AdditionalCertificateIds', description='The additional certificates. You can disassociate up to 15 additional certificates in each call.

This parameter is required.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: Validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  listenerId?: string(name='ListenerId', description='The listener ID. Only TCP/SSL listener IDs are supported.

This parameter is required.', example='lsn-bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model DisassociateAdditionalCertificatesWithListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
}

model DisassociateAdditionalCertificatesWithListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DisassociateAdditionalCertificatesWithListenerResponseBody(name='body'),
}

/**
 * @summary Disassociates additional certificates from a listener that uses SSL over TCP.
 *
 * @description **DisassociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/615175.html) operation to query the status of the task:
 * *   If an additional certificate is in the **Dissociating** state, the additional certificate is being disassociated.
 * *   If an additional certificate is in the **Dissociated** state, the additional certificate is disassociated.
 *
 * @param request DisassociateAdditionalCertificatesWithListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DisassociateAdditionalCertificatesWithListenerResponse
 */
async function disassociateAdditionalCertificatesWithListenerWithOptions(request: DisassociateAdditionalCertificatesWithListenerRequest, runtime: $RuntimeOptions): DisassociateAdditionalCertificatesWithListenerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.additionalCertificateIds)) {
    body['AdditionalCertificateIds'] = request.additionalCertificateIds;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DisassociateAdditionalCertificatesWithListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates additional certificates from a listener that uses SSL over TCP.
 *
 * @description **DisassociateAdditionalCertificatesWithListener** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [ListListenerCertificates](https://help.aliyun.com/document_detail/615175.html) operation to query the status of the task:
 * *   If an additional certificate is in the **Dissociating** state, the additional certificate is being disassociated.
 * *   If an additional certificate is in the **Dissociated** state, the additional certificate is disassociated.
 *
 * @param request DisassociateAdditionalCertificatesWithListenerRequest
 * @return DisassociateAdditionalCertificatesWithListenerResponse
 */
async function disassociateAdditionalCertificatesWithListener(request: DisassociateAdditionalCertificatesWithListenerRequest): DisassociateAdditionalCertificatesWithListenerResponse {
  var runtime = new $RuntimeOptions{};
  return disassociateAdditionalCertificatesWithListenerWithOptions(request, runtime);
}

model EnableLoadBalancerIpv6InternetRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model EnableLoadBalancerIpv6InternetResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model EnableLoadBalancerIpv6InternetResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnableLoadBalancerIpv6InternetResponseBody(name='body'),
}

/**
 * @summary Changes the network type of the IPv6 address of a dual-stack Network Load Balancer (NLB) instance from internal-facing to Internet-facing.
 *
 * @param request EnableLoadBalancerIpv6InternetRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnableLoadBalancerIpv6InternetResponse
 */
async function enableLoadBalancerIpv6InternetWithOptions(request: EnableLoadBalancerIpv6InternetRequest, runtime: $RuntimeOptions): EnableLoadBalancerIpv6InternetResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'EnableLoadBalancerIpv6Internet',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the network type of the IPv6 address of a dual-stack Network Load Balancer (NLB) instance from internal-facing to Internet-facing.
 *
 * @param request EnableLoadBalancerIpv6InternetRequest
 * @return EnableLoadBalancerIpv6InternetResponse
 */
async function enableLoadBalancerIpv6Internet(request: EnableLoadBalancerIpv6InternetRequest): EnableLoadBalancerIpv6InternetResponse {
  var runtime = new $RuntimeOptions{};
  return enableLoadBalancerIpv6InternetWithOptions(request, runtime);
}

model GetJobStatusRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  jobId?: string(name='JobId', description='The ID of the asynchronous job.

This parameter is required.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
}

model GetJobStatusResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='365F4154-92F6-4AE4-92F8-7FF34B540710'),
  status?: string(name='Status', description='The state of the task. Valid values:

*   **Succeeded**: The task is successful.
*   **processing**: The ticket is being executed.', example='Succeeded'),
}

model GetJobStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJobStatusResponseBody(name='body'),
}

/**
 * @summary Queries the result of an asynchronous operation performed on a Network Load Balancer (NLB) instance.
 *
 * @param request GetJobStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetJobStatusResponse
 */
async function getJobStatusWithOptions(request: GetJobStatusRequest, runtime: $RuntimeOptions): GetJobStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.jobId)) {
    query['JobId'] = request.jobId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetJobStatus',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the result of an asynchronous operation performed on a Network Load Balancer (NLB) instance.
 *
 * @param request GetJobStatusRequest
 * @return GetJobStatusResponse
 */
async function getJobStatus(request: GetJobStatusRequest): GetJobStatusResponse {
  var runtime = new $RuntimeOptions{};
  return getJobStatusWithOptions(request, runtime);
}

model GetListenerAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must ensure that it is unique among all requests. ClientToken can contain only ASCII characters.

>  If you do not set this parameter, **ClientToken** is set to the value of **RequestId**. The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@233'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model GetListenerAttributeResponseBody = {
  alpnEnabled?: boolean(name='AlpnEnabled', description='Indicates whether Application-Layer Protocol Negotiation (ALPN) is enabled. Valid values:

*   **true**: yes
*   **false**: no', example='false'),
  alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**
*   **HTTP2Only**
*   **HTTP2Preferred**
*   **HTTP2Optional**', example='HTTP1Only'),
  caCertificateIds?: [ string ](name='CaCertificateIds', description='The CA certificates. Only one CA certificate is supported.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  caEnabled?: boolean(name='CaEnabled', description='Indicates whether mutual authentication is enabled. Valid values:

*   **true**: yes
*   **false**: no', example='false'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificates. Only one server certificate is supported.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='1000'),
  endPort?: string(name='EndPort', description='The last port in the listening port range. Valid values: **0** to **65535**. The number of the last port must be smaller than that of the first port.', example='455'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period of an idle connection. Unit: seconds. Valid values: **1** to **900**.', example='900'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcpssl_443'),
  listenerId?: string(name='ListenerId', description='The ID of the listener.', example='lsn-bp1bpn0kn908w4nbw****@233'),
  listenerPort?: int32(name='ListenerPort', description='The listening port. Valid values: **0** to **65535**. A value of **0** specifies all ports. If you set the value to **0**, you must also set the **StartPort** and **EndPort** parameters.', example='233'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listening protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.', example='TCPSSL'),
  listenerStatus?: string(name='ListenerStatus', description='The status of the listener. Valid values:

*   **Provisioning**: The listener is being created.
*   **Running**: The listener is running.
*   **Configuring**: The listener is being configured.
*   **Stopping**: The listener is being stopped.
*   **Stopped**: The listener is stopped.
*   **Starting**: The listener is being started.
*   **Deleting**: The listener is being deleted.
*   **Deleted**: The listener is deleted.', example='Running'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.', example='nlb-83ckzc8d4xlp8o****'),
  mss?: int32(name='Mss', description='The size of the largest TCP segment. Unit: bytes. Valid values: **0** to **1500**. **0** specifies that the maximum segment size remains unchanged.

>  This parameter is supported only by listeners that use SSL over TCP.', example='166'),
  proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Indicates whether the Proxy protocol is used to pass client IP addresses to backend servers. Valid values:

*   **true**: yes
*   **false**: no', example='false'),
  proxyProtocolV2Config?: {
    ppv2PrivateLinkEpIdEnabled?: boolean(name='Ppv2PrivateLinkEpIdEnabled', description='Indicates whether the Proxy protocol passes the PrivateLinkEpId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
    ppv2PrivateLinkEpsIdEnabled?: boolean(name='Ppv2PrivateLinkEpsIdEnabled', description='Indicates whether the Proxy protocol passes the PrivateLinkEpsId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
    ppv2VpcIdEnabled?: boolean(name='Ppv2VpcIdEnabled', description='Indicates whether the Proxy protocol passes the VpcId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
  }(name='ProxyProtocolV2Config', description='Indicates whether the Proxy protocol passes the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  secSensorEnabled?: boolean(name='SecSensorEnabled', description='Indicates whether fine-grained monitoring is enabled. Valid values:

*   **true**: yes
*   **false**: no', example='false'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy. System security policies and custom security policies are supported.

- Valid values: **tls_cipher_policy_1_0**, **tls_cipher_policy_1_1**, **tls_cipher_policy_1_2**, **tls_cipher_policy_1_2_strict**, and **tls_cipher_policy_1_2_strict_with_1_3**.

- Custom security policy: the ID of the custom security policy.
    - For more information about how to create a custom security policy, see [CreateSecurityPolicy](https://help.aliyun.com/document_detail/2399231.html) .

    - For more information about how to query security policies, see [ListSecurityPolicy](https://help.aliyun.com/document_detail/2399234.html) .


>  This parameter takes effect only for listeners that use SSL over TCP.', example='tls_cipher_policy_1_0'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-ppdpc14gdm3x4o****'),
  startPort?: string(name='StartPort', description='The first port in the listening port range. Valid values: **0** to **65535**.', example='233'),
  tags?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='ac-cus-tag-4'),
      tagValue?: string(name='TagValue', description='The tag value.', example='ON'),
    }
  ](name='Tags', description='The tags.'),
}

model GetListenerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetListenerAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details of a Network Load Balancer (NLB) listener.
 *
 * @param request GetListenerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetListenerAttributeResponse
 */
async function getListenerAttributeWithOptions(request: GetListenerAttributeRequest, runtime: $RuntimeOptions): GetListenerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetListenerAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details of a Network Load Balancer (NLB) listener.
 *
 * @param request GetListenerAttributeRequest
 * @return GetListenerAttributeResponse
 */
async function getListenerAttribute(request: GetListenerAttributeRequest): GetListenerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return getListenerAttributeWithOptions(request, runtime);
}

model GetListenerHealthStatusRequest {
  listenerId?: string(name='ListenerId', description='The ID of the listener on the NLB instance.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model GetListenerHealthStatusResponseBody = {
  listenerHealthStatus?: [ 
    {
      listenerId?: string(name='ListenerId', description='The ID of the listener of the NLB instance.', example='lsn-bp1bpn0kn908w4nbw****@80'),
      listenerPort?: int32(name='ListenerPort', description='The listening port.', example='80'),
      listenerProtocol?: string(name='ListenerProtocol', description='The listening protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.', example='TCPSSL'),
      serverGroupInfos?: [ 
        {
          heathCheckEnabled?: boolean(name='HeathCheckEnabled', description='Indicates whether the health check feature is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
          nonNormalServers?: [ 
            {
              port?: int32(name='Port', description='The backend port.', example='80'),
              reason?: {
                reasonCode?: string(name='ReasonCode', description='The reason why the **status** is abnormal. Valid values:

*   **CONNECT_TIMEOUT**: The NLB instance failed to connect to the backend server within the specified period of time.
*   **CONNECT_FAILED**: The NLB instance failed to connect to the backend server.
*   **RECV_RESPONSE_TIMEOUT**: The NLB instance failed to receive a response from the backend server within the specified period of time.
*   **CONNECT_INTERRUPT**: The connection between the health check and the backend servers was interrupted.
*   **HTTP_CODE_NOT_MATCH**: The HTTP status code from the backend servers was not the expected one.
*   **HTTP_INVALID_HEADER**: The format of the response from the backend servers is invalid.', example='CONNECT_TIMEOUT'),
              }(name='Reason', description='The cause of the health check failure.'),
              serverId?: string(name='ServerId', description='The ID of the backend server.', example='i-bp1bt75jaujl7tjl****'),
              serverIp?: string(name='ServerIp', description='The IP address of the backend server.', example='192.168.8.10'),
              status?: string(name='Status', description='The health check status. Valid values:

*   **Initial**: indicates that health checks are configured for the NLB instance, but no data was found.
*   **Unhealthy**: indicates that the backend server consecutively fails health checks.
*   **Unavailable**: indicates that health checks are disabled.', example='Initial'),
            }
          ](name='NonNormalServers', description='A list of unhealthy backend servers.'),
          serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-ppdpc14gdm3x4o****'),
        }
      ](name='ServerGroupInfos', description='The information about the server groups.'),
    }
  ](name='ListenerHealthStatus', description='The health check status of the server group of the listener.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

- If **NextToken** is empty, it indicates that no next query is to be sent.
- If a value of **NextToken** is returned, the value is the token used for the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='10'),
}

model GetListenerHealthStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetListenerHealthStatusResponseBody(name='body'),
}

/**
 * @summary Queries the health check status of a Network Load Balancer (NLB) listener.
 *
 * @param request GetListenerHealthStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetListenerHealthStatusResponse
 */
async function getListenerHealthStatusWithOptions(request: GetListenerHealthStatusRequest, runtime: $RuntimeOptions): GetListenerHealthStatusResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.listenerId)) {
    query['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetListenerHealthStatus',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the health check status of a Network Load Balancer (NLB) listener.
 *
 * @param request GetListenerHealthStatusRequest
 * @return GetListenerHealthStatusResponse
 */
async function getListenerHealthStatus(request: GetListenerHealthStatusRequest): GetListenerHealthStatusResponse {
  var runtime = new $RuntimeOptions{};
  return getListenerHealthStatusWithOptions(request, runtime);
}

model GetLoadBalancerAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model GetLoadBalancerAttributeResponseBody = {
  addressIpVersion?: string(name='AddressIpVersion', description='The protocol version. Valid values:

*   **ipv4**: IPv4
*   **DualStack**: dual stack', example='ipv4'),
  addressType?: string(name='AddressType', description='The IPv4 network type of the NLB instance. Valid values:

*   **Internet** The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.
*   **Intranet** The domain name of the NLB instance is resolved to the private IP address. Therefore, the NLB instance can be accessed over the VPC in which the NLB instance is deployed.', example='Internet'),
  bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the EIP bandwidth plan.', example='cbwp-bp1vevu8h3ieh****'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the NLB instance in each zone (virtual IP address). Valid values: **0** to **1000000**.

**0** indicates that the number of connections is unlimited.', example='100'),
  createTime?: string(name='CreateTime', description='The time when the NLB instance was created. This value is a UNIX timestamp.

Unit: milliseconds.', example='2022-07-02T02:49:05Z'),
  crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Indicates whether the NLB instance is accessible across zones. Valid values:

*   **true**
*   **false**', example='true'),
  DNSName?: string(name='DNSName', description='The domain name of the NLB instance.', example='nlb-wb7r6dlwetvt5j****.cn-hangzhou.nlb.aliyuncs.com'),
  deletionProtectionConfig?: {
    enabled?: boolean(name='Enabled', description='Specifies whether to enable deletion protection. Valid values:

*   **true**: yes
*   **false** (default): no', example='true'),
    enabledTime?: string(name='EnabledTime', description='The time when the deletion protection feature was enabled. The time follows the ISO 8601 standard in the `yyyy-MM-ddTHH:mm:ssZ` format. The time is displayed in UTC.', example='2022-11-02T02:49:05Z'),
    reason?: string(name='Reason', description='The reason why the deletion protection feature is enabled or disabled. The value must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The value must start with a letter.', example='create-by-mse-can-not-delete'),
  }(name='DeletionProtectionConfig', description='The configuration of the deletion protection feature.'),
  ipv6AddressType?: string(name='Ipv6AddressType', description='The IPv6 network type of the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. In this case, the NLB instance can be accessed over the VPC where the NLB instance is deployed.', example='Internet'),
  loadBalancerBillingConfig?: {
    payType?: string(name='PayType', description='The billing method of the NLB instance. Set the value to **PostPay**, which specifies the pay-as-you-go billing method.', example='PostPay'),
  }(name='LoadBalancerBillingConfig', description='The billing information of the NLB instance.'),
  loadBalancerBusinessStatus?: string(name='LoadBalancerBusinessStatus', description='The status of workloads on the NLB instance. Valid values:

*   **Abnormal**
*   **Normal**', example='Normal'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.', example='nlb-83ckzc8d4xlp8o****'),
  loadBalancerName?: string(name='LoadBalancerName', description='The NLB instance name.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='NLB1'),
  loadBalancerStatus?: string(name='LoadBalancerStatus', description='The NLB instance status. Valid values:

*   **Inactive**: The NLB instance is disabled. The listeners of NLB instances in the Inactive state do not forward traffic.
*   **Active**: The NLB instance is running.
*   **Provisioning**: The NLB instance is being created.
*   **Configuring**: The NLB instance is being modified.
*   **CreateFailed**: The system failed to create the NLB instance. In this case, you are not charged for the NLB instance. You can only delete the NLB instance.', example='Active'),
  loadBalancerType?: string(name='LoadBalancerType', description='The type of the Server Load Balancer (SLB) instance. Set the value to **network**, which specifies NLB.', example='network'),
  modificationProtectionConfig?: {
    enabledTime?: string(name='EnabledTime', description='The time when the modification protection feature was enabled. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.', example='2022-12-02T02:49:05Z'),
    reason?: string(name='Reason', description='The reason why the configuration read-only mode is enabled. The value must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The value must start with a letter.

>  This parameter takes effect only if the **Status** parameter is set to **ConsoleProtection**.', example='create-by-mse-cannot-modify'),
    status?: string(name='Status', description='Specifies whether to enable the configuration read-only mode. Valid values:

*   **NonProtection**: does not enable the configuration read-only mode. You cannot set the **Reason** parameter. If the **Reason** parameter is set, the value is cleared.
*   **ConsoleProtection**: enables the configuration read-only mode. You can set the **Reason** parameter.

>  If you set this parameter to **ConsoleProtection**, you cannot use the NLB console to modify instance configurations. However, you can call API operations to modify instance configurations.', example='ConsoleProtection'),
  }(name='ModificationProtectionConfig', description='The configuration of the configuration read-only mode.'),
  operationLocks?: [ 
    {
      lockReason?: string(name='LockReason', description='The reason why the NLB instance is locked.', example='security'),
      lockType?: string(name='LockType', description='The type of the lock. Valid values:

*   **SecurityLocked**: The NLB instance is locked due to security reasons.
*   **RelatedResourceLocked**: The NLB instance is locked due to other resources associated with the NLB instance.
*   **FinancialLocked**: The NLB instance is locked due to overdue payments.
*   **ResidualLocked**: The NLB instance is locked because the associated resources have overdue payments and the resources are released.', example='SecurityLocked'),
    }
  ](name='OperationLocks', description='The information about the locked NLB instance. This parameter is returned only when `LoadBalancerBussinessStatus` is **Abnormal**.'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The ID of the security group associated with the NLB instance.'),
  tags?: [ 
    {
      tagKey?: string(name='TagKey', description='The tag key.', example='KeyTest'),
      tagValue?: string(name='TagValue', description='The tag value.', example='ValueTest'),
    }
  ](name='Tags', description='The tags.'),
  vpcId?: string(name='VpcId', description='The VPC ID of the NLB instance.', example='vpc-bp1b49rqrybk45nio****'),
  zoneMappings?: [ 
    {
      loadBalancerAddresses?: [ 
        {
          allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP).', example='eip-bp1aedxso6u80u0qf****'),
          eniId?: string(name='EniId', description='The ID of the elastic network interface (ENI).', example='eni-bp12f1xhs5yal61a****'),
          ipv4LocalAddresses?: [ string ](name='Ipv4LocalAddresses', description='The IPv4 link-local addresses. The IP addresses that the NLB instance uses to communicate with the backend servers.'),
          ipv6Address?: string(name='Ipv6Address', description='The IPv6 address of the NLB instance.', example='2001:db8:1:1:1:1:1:1'),
          ipv6LocalAddresses?: [ string ](name='Ipv6LocalAddresses', description='The IPv6 link-local addresses. The IP addresses that the NLB instance uses to communicate with the backend servers.'),
          privateIPv4Address?: string(name='PrivateIPv4Address', description='The private IPv4 address of the NLB instance.', example='192.168.3.32'),
          privateIPv4HcStatus?: string(name='PrivateIPv4HcStatus', description='The health status of the private IPv4 address of the NLB instance. Valid values:

*   **Healthy**
*   **Unhealthy**

> This parameter is returned only when the **Status** of the zone is **Active**.', example='Healthy'),
          privateIPv6HcStatus?: string(name='PrivateIPv6HcStatus', description='The health status of the IPv6 address of the NLB instance. Valid values:

*   **Healthy**
*   **Unhealthy**

> This parameter is returned only when the **Status** of the zone is **Active**.', example='Healthy'),
          publicIPv4Address?: string(name='PublicIPv4Address', description='The public IPv4 address of the NLB instance.', example='120.XX.XX.69'),
        }
      ](name='LoadBalancerAddresses', description='The information about the IP addresses used by the NLB instance.'),
      status?: string(name='Status', description='The zone status. Valid values:

*   **Active**: The zone is available.
*   **Stopped**: The zone is disabled. You can set the zone to this status only by using Cloud Architect Design Tools (CADT).
*   **Shifted**: The DNS record is removed.
*   **Starting**: The zone is being enabled. You can set the zone to this status only by using CADT.
*   **Stopping** You can set the zone to this status only by using CADT.', example='Active'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone contains one vSwitch and one subnet.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The ID of the zone. You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The list of zones and vSwitches in the zones. You must specify 2 to 10 zones.'),
}

model GetLoadBalancerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetLoadBalancerAttributeResponseBody(name='body'),
}

/**
 * @summary Queries the details about a Network Load Balancer (NLB) instance.
 *
 * @param request GetLoadBalancerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetLoadBalancerAttributeResponse
 */
async function getLoadBalancerAttributeWithOptions(request: GetLoadBalancerAttributeRequest, runtime: $RuntimeOptions): GetLoadBalancerAttributeResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    query['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    query['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetLoadBalancerAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the details about a Network Load Balancer (NLB) instance.
 *
 * @param request GetLoadBalancerAttributeRequest
 * @return GetLoadBalancerAttributeResponse
 */
async function getLoadBalancerAttribute(request: GetLoadBalancerAttributeRequest): GetLoadBalancerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return getLoadBalancerAttributeWithOptions(request, runtime);
}

model ListListenerCertificatesRequest {
  certType?: string(name='CertType', description='The type of the certificate. Valid values:

*   **Ca**: CA certificate.
*   **Server**: server certificate', example='Ca'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificate. Only one server certificate is supported.

>  This parameter takes effect only for TCP/SSL listeners.', nullable=true),
  listenerId?: string(name='ListenerId', description='The ID of the listener. Specify the ID of a listener that uses SSL over TCP.

This parameter is required.', example='lsn-j49ht1jxxqyg45****@80'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return on each page. Valid values: **1** to **50**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of NextToken.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the Network Load Balancer (NLB) instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model ListListenerCertificatesResponseBody = {
  certificateIds?: [ string ](name='CertificateIds', description='The server certificates.'),
  certificates?: [ 
    {
      certificateId?: string(name='CertificateId', description='The ID of the certificate. Only one server certificate is supported.', example='12315790343_166f8204689_1714763408_70998****'),
      certificateType?: string(name='CertificateType', description='The type of the certificate.', example='Server'),
      isDefault?: boolean(name='IsDefault', description='Indicates whether the certificate is the default certificate of the listener. Valid values:

*   **true**
*   **false**', example='true'),
      status?: string(name='Status', description='Indicates whether the certificate is associated with the listener. Valid values:

*   **Associating**
*   **Associated**
*   **Diassociating**', example='Associating'),
    }
  ](name='Certificates', description='The certificates.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page. Valid values: **1** to **50**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The returned value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of NextToken.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='2198BD6D-9EBB-5E1C-9C48-E0ABB79CF831'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListListenerCertificatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenerCertificatesResponseBody(name='body'),
}

/**
 * @summary Queries the server certificate of a TCP/SSL listener.
 *
 * @param request ListListenerCertificatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificatesWithOptions(request: ListListenerCertificatesRequest, runtime: $RuntimeOptions): ListListenerCertificatesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.certType)) {
    body['CertType'] = request.certType;
  }
  if (!$isNull(request.certificateIds)) {
    body['CertificateIds'] = request.certificateIds;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListListenerCertificates',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the server certificate of a TCP/SSL listener.
 *
 * @param request ListListenerCertificatesRequest
 * @return ListListenerCertificatesResponse
 */
async function listListenerCertificates(request: ListListenerCertificatesRequest): ListListenerCertificatesResponse {
  var runtime = new $RuntimeOptions{};
  return listListenerCertificatesWithOptions(request, runtime);
}

model ListListenersRequest {
  listenerIds?: [ string ](name='ListenerIds', description='The listener IDs. You can specify up to 20 listeners.'),
  listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.', example='TCPSSL'),
  loadBalancerIds?: [ string ](name='LoadBalancerIds', description='The IDs of the NLB instances. You can specify up to 20 instances.'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return in each call. Valid values: **1** to **100**. Default value: **20**', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token used to specify a particular page of results. Valid values:

*   Leave this parameter empty for the first query or the only query.
*   Set this parameter to the value of NextToken obtained from the previous query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  secSensorEnabled?: string(name='SecSensorEnabled', description='Specifies whether to enable fine-grained monitoring. Valid values:

*   **true**
*   **false**', example='false'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. You can specify up to 20 tags. The tag key cannot be an empty string.

It can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The value of the tag. You can specify up to 20 tags. The tag value can be an empty string.

It can be up to 128 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags.'),
}

model ListListenersResponseBody = {
  listeners?: [ 
    {
      alpnEnabled?: boolean(name='AlpnEnabled', description='Indicates whether Application-Layer Protocol Negotiation (ALPN) is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**
*   **HTTP2Only**
*   **HTTP2Preferred**
*   **HTTP2Optional**', example='HTTP1Only'),
      caCertificateIds?: [ string ](name='CaCertificateIds', description='A list of CA certificates.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
      caEnabled?: boolean(name='CaEnabled', description='Indicates whether mutual authentication is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      certificateIds?: [ string ](name='CertificateIds', description='The server certificate.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
      cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='1000'),
      endPort?: string(name='EndPort', description='The last port in the listener port range.', example='455'),
      idleTimeout?: int32(name='IdleTimeout', description='The timeout period of idle connections. Unit: seconds. Valid values: **1** to **900**. Default value: **900**.', example='900'),
      listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcpssl_443'),
      listenerId?: string(name='ListenerId', description='The listener ID.', example='lsn-ga6sjjcll6ou34l1et****'),
      listenerPort?: int32(name='ListenerPort', description='The information about the listener port of your server.', example='443'),
      listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid values: **TCP**, **UDP**, and **TCPSSL**.', example='TCPSSL'),
      listenerStatus?: string(name='ListenerStatus', description='The status of the listener. Valid values:

*   **Provisioning**: The listener is being created.
*   **Running**: The listener is running.
*   **Configuring**: The listener is being configured.
*   **Stopping**: The listener is being stopped.
*   **Stopped**: The listener is stopped.
*   **Starting**: The listener is being started.
*   **Deleting**: The listener is being deleted.
*   **Deleted**: The listener is deleted.', example='Running'),
      loadBalancerId?: string(name='LoadBalancerId', description='The CLB instance ID.', example='nlb-83ckzc8d4xlp8o****'),
      mss?: int32(name='Mss', description='The size of the largest TCP packet segment. Unit: bytes. Valid values: **0** to **1500**. **0** indicates that the Mss value of TCP packets remains unchanged.

>  This parameter takes effect only for listeners that use SSL over TCP.', example='200'),
      proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Indicates whether the Proxy protocol passes source client IP addresses to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
      proxyProtocolV2Config?: {
        ppv2PrivateLinkEpIdEnabled?: boolean(name='Ppv2PrivateLinkEpIdEnabled', description='Indicates whether the Proxy protocol passes the PrivateLinkEpId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
        ppv2PrivateLinkEpsIdEnabled?: boolean(name='Ppv2PrivateLinkEpsIdEnabled', description='Indicates whether the Proxy protocol passes the PrivateLinkEpsId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
        ppv2VpcIdEnabled?: boolean(name='Ppv2VpcIdEnabled', description='Indicates whether the Proxy protocol passes the VpcId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
      }(name='ProxyProtocolV2Config', description='Indicates whether the Proxy protocol passes the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
      regionId?: string(name='RegionId', description='The region ID of the NLB instance.', example='cn-hangzhou'),
      secSensorEnabled?: boolean(name='SecSensorEnabled', description='Indicates whether fine-grained monitoring is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.

>  This parameter takes effect only for listeners that use SSL over TCP.', example='tls_cipher_policy_1_1'),
      serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-ppdpc14gdm3x4o****'),
      startPort?: string(name='StartPort', description='The first port in the listener port range.', example='233'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='Created'),
          value?: string(name='Value', description='The tag value.', example='TF'),
        }
      ](name='Tags', description='A list of tags.'),
    }
  ](name='Listeners', description='The listeners.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If **NextToken** is empty, it indicates that no next query is to be sent.
*   If a value of **NextToken** is returned, the value is the token used for the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='4'),
}

model ListListenersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListListenersResponseBody(name='body'),
}

/**
 * @summary Queries listeners added to a Network Load Balancer (NLB) instance.
 *
 * @param request ListListenersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListListenersResponse
 */
async function listListenersWithOptions(request: ListListenersRequest, runtime: $RuntimeOptions): ListListenersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.listenerIds)) {
    query['ListenerIds'] = request.listenerIds;
  }
  if (!$isNull(request.listenerProtocol)) {
    query['ListenerProtocol'] = request.listenerProtocol;
  }
  if (!$isNull(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.secSensorEnabled)) {
    query['SecSensorEnabled'] = request.secSensorEnabled;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListListeners',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries listeners added to a Network Load Balancer (NLB) instance.
 *
 * @param request ListListenersRequest
 * @return ListListenersResponse
 */
async function listListeners(request: ListListenersRequest): ListListenersResponse {
  var runtime = new $RuntimeOptions{};
  return listListenersWithOptions(request, runtime);
}

model ListLoadBalancersRequest {
  addressIpVersion?: string(name='AddressIpVersion', description='The IP version of the NLB instance. Valid values:

*   **ipv4**: IPv4
*   **DualStack**: dual-stack', example='ipv4'),
  addressType?: string(name='AddressType', description='The type of IPv4 address used by the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. The NLB instance can be accessed over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. The NLB instance can be accessed over the VPC where the NLB instance is deployed.', example='Internet'),
  DNSName?: string(name='DNSName', description='The domain name of the NLB instance.', example='nlb-wb7r6dlwetvt5j****.cn-hangzhou.nlb.aliyuncs.com'),
  ipv6AddressType?: string(name='Ipv6AddressType', description='The type of IPv6 address used by the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. The NLB instance can be accessed over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. The NLB instance can be accessed over the VPC where the NLB instance is deployed.', example='Internet'),
  loadBalancerBusinessStatus?: string(name='LoadBalancerBusinessStatus', description='The business status of the NLB instance. Valid values:

*   **Abnormal**: The NLB instance is not working as expected.
*   **Normal**: The NLB instance is working as expected.', example='Normal'),
  loadBalancerIds?: [ string ](name='LoadBalancerIds', description='The NLB instance IDs. You can specify up to 20 IDs in each call.'),
  loadBalancerNames?: [ string ](name='LoadBalancerNames', description='The names of the NLB instances. You can specify up to 20 names in each call.'),
  loadBalancerStatus?: string(name='LoadBalancerStatus', description='The status of the NLB instance. Valid values:

*   **Inactive**: The NLB instance is disabled. Listeners of an NLB instance in the Inactive state do not forward traffic.
*   **Active**: The NLB instance is running.
*   **Provisioning**: The NLB instance is being created.
*   **Configuring**: The NLB instance is being modified.
*   **Deleting**: The NLB instance is being deleted.
*   **Deleted**: The NLB instance is deleted.', example='Active'),
  loadBalancerType?: string(name='LoadBalancerType', description='The type of the Server Load Balancer (SLB) instances. Set the value to **network**, which specifies NLB.', example='network'),
  maxResults?: int32(name='MaxResults', description='The number of entries to return in each call. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token used to specify a particular page of results. Valid values:

*   Leave this parameter empty for the first query or the only query.
*   Set this parameter to the value of NextToken obtained from the previous query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the instance belongs.', example='rg-atstuj3rtop****'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. You can specify up to 20 tags. The tag key cannot be an empty string.

It must be 1 to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='KeyTest'),
      value?: string(name='Value', description='The value of the tag. You can specify up to 20 tags. The tag value can be an empty string.

The tag value can be up to 128 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`.', example='ValueTest'),
    }
  ](name='Tag', description='The tags of the NLB instance.'),
  vpcIds?: [ string ](name='VpcIds', description='The IDs of the virtual private clouds (VPCs) where the NLB instances are deployed. You can specify up to 10 VPC IDs in each call.'),
  zoneId?: string(name='ZoneId', description='The ID of the zone. You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.', example='cn-hangzhou-a'),
}

model ListLoadBalancersResponseBody = {
  loadBalancers?: [ 
    {
      addressIpVersion?: string(name='AddressIpVersion', description='The IP version. Valid values:

*   **ipv4**: IPv4
*   **DualStack**: dual stack', example='ipv4'),
      addressType?: string(name='AddressType', description='The type of IPv4 address used by the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. Therefore, the NLB instance can be accessed over the VPC where the NLB instance is deployed.', example='Internet'),
      bandwidthPackageId?: string(name='BandwidthPackageId', description='The ID of the EIP bandwidth plan that is associated with the NLB instance if the NLB instance uses a public IP address.', example='cbwp-bp1vevu8h3ieh****'),
      createTime?: string(name='CreateTime', description='The time when the resource was created. The time is displayed in UTC in the `yyyy-MM-ddTHH:mm:ssZ` format.', example='2022-07-18T17:22Z'),
      crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Indicates whether cross-zone load balancing is enabled for the NLB instance. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
      DNSName?: string(name='DNSName', description='The domain name of the NLB instance.', example='nlb-wb7r6dlwetvt5j****.cn-hangzhou.nlb.aliyuncs.com'),
      deletionProtectionConfig?: {
        enabled?: boolean(name='Enabled', description='Indicates whether deletion protection is enabled. Valid values:

*   **true**: enabled
*   **false**: disabled', example='true'),
        enabledTime?: string(name='EnabledTime', description='The time when deletion protection was enabled. The time is displayed in UTC in `yyyy-MM-ddTHH:mm:ssZ` format.', example='2022-12-01T17:22Z'),
        reason?: string(name='Reason', description='The reason why the deletion protection feature is enabled or disabled. The reason must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The reason must start with a letter.', example='The instance is running'),
      }(name='DeletionProtectionConfig', description='The configuration of the deletion protection feature.'),
      ipv6AddressType?: string(name='Ipv6AddressType', description='The type of IPv6 address used by the NLB instance. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. Therefore, the NLB instance can be accessed over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. Therefore, the NLB instance can be accessed over the VPC where the NLB instance is deployed.', example='Internet'),
      loadBalancerBillingConfig?: {
        payType?: string(name='PayType', description='The billing method of the NLB instance. Only **PostPay** is supported, which indicates the pay-as-you-go billing method.', example='PostPay'),
      }(name='LoadBalancerBillingConfig', description='The billing settings of the NLB instance.'),
      loadBalancerBusinessStatus?: string(name='LoadBalancerBusinessStatus', description='The business status of the NLB instance. Valid values:

*   **Abnormal**: The NLB instance is not working as expected.
*   **Normal**: The NLB instance is working as expected.', example='Normal'),
      loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.', example='nlb-83ckzc8d4xlp8o****'),
      loadBalancerName?: string(name='LoadBalancerName', description='The name of the NLB instance.', example='NLB1'),
      loadBalancerStatus?: string(name='LoadBalancerStatus', description='The status of the NLB instance. Valid values:

*   **Inactive**: The NLB instance is disabled. Listeners of NLB instances in the Inactive state do not forward traffic.
*   **Active**: The NLB instance is running.
*   **Provisioning**: The NLB instance is being created.
*   **Configuring**: The NLB instance is being modified.
*   **Deleting**: The NLB instance is being deleted.
*   **Deleted**: The NLB instance is deleted.', example='Active'),
      loadBalancerType?: string(name='LoadBalancerType', description='The type of the SLB instance. Only **Network** is returned, which indicates NLB.', example='Network'),
      modificationProtectionConfig?: {
        enabledTime?: string(name='EnabledTime', description='The time when the configuration read-only mode was enabled. The time is displayed in UTC in `yyyy-MM-ddTHH:mm:ssZ` format.', example='2022-12-01T17:22Z'),
        reason?: string(name='Reason', description='The reason why the configuration read-only mode is enabled. The reason must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The reason must start with a letter.

This parameter takes effect only if **Status** is set to **ConsoleProtection**.', example='Service guarantee period'),
        status?: string(name='Status', description='Indicates whether the configuration read-only mode is enabled. Valid values:

*   **NonProtection**: disabled. In this case, **Reason** is not returned. If **Reason** is set, the value is cleared.
*   **ConsoleProtection**: enabled. In this case, **Reason** is returned.

>  If you set this parameter to **ConsoleProtection**, you cannot use the NLB console to modify instance configurations. However, you can call API operations to modify instance configurations.', example='ConsoleProtection'),
      }(name='ModificationProtectionConfig', description='The configuration of the configuration read-only mode.'),
      operationLocks?: [ 
        {
          lockReason?: string(name='LockReason', description='The reason why the NLB instance is locked.', example='Service exception'),
          lockType?: string(name='LockType', description='The type of lock. Valid values:

*   **SecurityLocked**: The NLB instance is locked due to security reasons.
*   **RelatedResourceLocked**: The NLB instance is locked due to association issues.
*   **FinancialLocked**: The NLB instance is locked due to overdue payments.
*   **ResidualLocked**: The NLB instance is locked because the payments of the associated resources are overdue and the resources are released.', example='SecurityLocked'),
        }
      ](name='OperationLocks', description='The configuration of the operation lock. This parameter takes effect if the value of `LoadBalancerBussinessStatus` is **Abnormal**.'),
      regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group.', example='rg-atstuj3rtop****'),
      securityGroupIds?: [ string ](name='SecurityGroupIds', description='The security group to which the NLB instance is added.'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key.', example='KeyTest'),
          value?: string(name='Value', description='The tag value.', example='ValueTest'),
        }
      ](name='Tags', description='A list of tags.'),
      vpcId?: string(name='VpcId', description='The ID of the VPC where the NLB instance is deployed.', example='vpc-bp1b49rqrybk45nio****'),
      zoneMappings?: [ 
        {
          loadBalancerAddresses?: [ 
            {
              allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP).', example='eip-bp1aedxso6u80u0qf****'),
              eniId?: string(name='EniId', description='The ID of the elastic network interface (ENI) attached to the NLB instance.', example='eni-bp12f1xhs5yal61a****'),
              ipv6Address?: string(name='Ipv6Address', description='The IPv6 address used by the NLB instance.', example='2001:db8:1:1:1:1:1:1'),
              privateIPv4Address?: string(name='PrivateIPv4Address', description='The private IPv4 address of the NLB instance.', example='192.168.3.32'),
              privateIPv4HcStatus?: string(name='PrivateIPv4HcStatus', description='The health status of the private IPv4 address of the NLB instance. Valid values:

- **Healthy**
- **Unhealthy**

> This parameter is returned only when the Status of the zone is Active.', example='Healthy'),
              privateIPv6HcStatus?: string(name='PrivateIPv6HcStatus', description='The health status of the IPv6 address of the NLB instance. Valid values:

- **Healthy**
- **Unhealthy**

> This parameter is returned only when the Status of the zone is Active.', example='Healthy'),
              publicIPv4Address?: string(name='PublicIPv4Address', description='The public IPv4 address of the NLB instance.', example='120.XX.XX.69'),
            }
          ](name='LoadBalancerAddresses', description='The IP addresses that are used by the NLB instance.'),
          status?: string(name='Status', description='The zone status. Valid values:

- **Active**: The zone is available.

- **Stopped**: The zone is disabled. You can set the zone to this status only by using Cloud Architect Design Tools (CADT).

- **Shifted**: The DNS record is removed.

- **Starting**: The zone is being enabled. You can set the zone to this status only by using CADT.

- **Stopping** You can set the zone to this status only by using CADT.', example='Active'),
          vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone contains one vSwitch and one subnet.', example='vsw-bp1rmcrwg3erh1fh8****'),
          zoneId?: string(name='ZoneId', description='The name of the zone. You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the zones.', example='cn-hangzhou-a'),
        }
      ](name='ZoneMappings', description='The mappings between zones and vSwitches.'),
    }
  ](name='LoadBalancers', description='The NLB instances.'),
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that determines the start point of the next query. Valid values:

*   If this is your first query and no subsequent queries are to be sent, ignore this parameter.
*   If a subsequent query is to be sent, set the parameter to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListLoadBalancersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListLoadBalancersResponseBody(name='body'),
}

/**
 * @summary Queries the basic information about Network Load Balancer (NLB) instances.
 *
 * @param request ListLoadBalancersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListLoadBalancersResponse
 */
async function listLoadBalancersWithOptions(request: ListLoadBalancersRequest, runtime: $RuntimeOptions): ListLoadBalancersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.addressIpVersion)) {
    query['AddressIpVersion'] = request.addressIpVersion;
  }
  if (!$isNull(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!$isNull(request.DNSName)) {
    query['DNSName'] = request.DNSName;
  }
  if (!$isNull(request.ipv6AddressType)) {
    query['Ipv6AddressType'] = request.ipv6AddressType;
  }
  if (!$isNull(request.loadBalancerBusinessStatus)) {
    query['LoadBalancerBusinessStatus'] = request.loadBalancerBusinessStatus;
  }
  if (!$isNull(request.loadBalancerIds)) {
    query['LoadBalancerIds'] = request.loadBalancerIds;
  }
  if (!$isNull(request.loadBalancerNames)) {
    query['LoadBalancerNames'] = request.loadBalancerNames;
  }
  if (!$isNull(request.loadBalancerStatus)) {
    query['LoadBalancerStatus'] = request.loadBalancerStatus;
  }
  if (!$isNull(request.loadBalancerType)) {
    query['LoadBalancerType'] = request.loadBalancerType;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!$isNull(request.vpcIds)) {
    query['VpcIds'] = request.vpcIds;
  }
  if (!$isNull(request.zoneId)) {
    query['ZoneId'] = request.zoneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListLoadBalancers',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the basic information about Network Load Balancer (NLB) instances.
 *
 * @param request ListLoadBalancersRequest
 * @return ListLoadBalancersResponse
 */
async function listLoadBalancers(request: ListLoadBalancersRequest): ListLoadBalancersResponse {
  var runtime = new $RuntimeOptions{};
  return listLoadBalancersWithOptions(request, runtime);
}

model ListSecurityPolicyRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries to return per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token that is used in the next request to retrieve a new page of results. Valid values:

*   You do not need to specify this parameter for the first request.
*   You must specify the token that is obtained from the previous query as the value of NextToken.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-atstuj3rtop****'),
  securityPolicyIds?: [ string ](name='SecurityPolicyIds', description='The IDs of the TLS security policies. You can specify at most 20 policy IDs in each call.'),
  securityPolicyNames?: [ string ](name='SecurityPolicyNames', description='The names of the TLS security policies. You can specify at most 20 policy names.'),
  tag?: [ 
    {
      key?: string(name='Key', description='The tag key. You can specify up to 10 tag keys.

The tag key can be up to 64 characters in length. It cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.', example='Test'),
      value?: string(name='Value', description='The tag value. You can specify up to 10 tag values.

The tag value can be up to 128 characters in length. It cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.', example='Test'),
    }
  ](name='Tag', description='The tags.'),
}

model ListSecurityPolicyResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If NextToken is empty, no next page exists.
*   If a value is returned for NextToken, specify the value in the next request to retrieve a new page of results.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D7A8875F-373A-5F48-8484-25B07A61F2AF'),
  securityPolicies?: [ 
    {
      ciphers?: string(name='Ciphers', description='The supported cipher suites, which are determined by the TLS protocol version. You can specify at most 32 cipher suites.

TLS 1.0 and TLS 1.1 support the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**

TLS 1.2 supports the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**
*   **ECDHE-ECDSA-AES128-GCM-SHA256**
*   **ECDHE-ECDSA-AES256-GCM-SHA384**
*   **ECDHE-ECDSA-AES128-SHA256**
*   **ECDHE-ECDSA-AES256-SHA384**
*   **ECDHE-RSA-AES128-GCM-SHA256**
*   **ECDHE-RSA-AES256-GCM-SHA384**
*   **ECDHE-RSA-AES128-SHA256**
*   **ECDHE-RSA-AES256-SHA384**
*   **AES128-GCM-SHA256**
*   **AES256-GCM-SHA384**
*   **AES128-SHA256**
*   **AES256-SHA256**

TLS 1.3 supports the following cipher suites:

*   **TLS_AES_128_GCM_SHA256**
*   **TLS_AES_256_GCM_SHA384**
*   **TLS_CHACHA20_POLY1305_SHA256**
*   **TLS_AES_128_CCM_SHA256**
*   **TLS_AES_128_CCM_8_SHA256**', example='ECDHE-ECDSA-AES128-SHA'),
      regionId?: string(name='RegionId', description='The region ID of the NLB instance.', example='cn-hangzhou'),
      relatedListeners?: [ 
        {
          listenerId?: string(name='ListenerId', description='The listener ID.', example='lsn-bp1bpn0kn908w4nbw****@443'),
          listenerPort?: long(name='ListenerPort', description='The listener port.', example='443'),
          listenerProtocol?: string(name='ListenerProtocol', description='The listener protocol. Valid value: **TCPSSL**.', example='TCPSSL'),
          loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.', example='nlb-83ckzc8d4xlp8o****'),
        }
      ](name='RelatedListeners', description='The listeners that are associated with the NLB instance.'),
      resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-atstuj3rtop****'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.', example='tls-bp14bb1e7dll4f****'),
      securityPolicyName?: string(name='SecurityPolicyName', description='The name of the TLS security policy.', example='TLSCipherPolicy'),
      securityPolicyStatus?: string(name='SecurityPolicyStatus', description='The status of the TLS security policy. Valid values:

*   **Configuring**
*   **Available**', example='Available'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. You can specify up to 10 tag keys.

The tag key can be up to 64 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
          value?: string(name='Value', description='The tag value. You can specify up to 10 tag values.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
        }
      ](name='Tags', description='The tags.'),
      tlsVersion?: string(name='TlsVersion', description='The supported versions of the TLS protocol. Valid values: **TLSv1.0**, **TLSv1.1**, **TLSv1.2**, and **TLSv1.3**.', example='TLSv1.0'),
    }
  ](name='SecurityPolicies', description='The TLS security policies.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the TLS security policies set for a Network Load Balancer (NLB) instance.
 *
 * @param request ListSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSecurityPolicyResponse
 */
async function listSecurityPolicyWithOptions(request: ListSecurityPolicyRequest, runtime: $RuntimeOptions): ListSecurityPolicyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.securityPolicyIds)) {
    body['SecurityPolicyIds'] = request.securityPolicyIds;
  }
  if (!$isNull(request.securityPolicyNames)) {
    body['SecurityPolicyNames'] = request.securityPolicyNames;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSecurityPolicy',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the TLS security policies set for a Network Load Balancer (NLB) instance.
 *
 * @param request ListSecurityPolicyRequest
 * @return ListSecurityPolicyResponse
 */
async function listSecurityPolicy(request: ListSecurityPolicyRequest): ListSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return listSecurityPolicyWithOptions(request, runtime);
}

model ListServerGroupServersRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries to return in each call. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token used to specify a particular page of results. Valid values:

*   Left this parameter empty if this is the first query or the only query.
*   Set this parameter to the value of NextToken obtained from the previous query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-atstuj3rtoptyui****'),
  serverIds?: [ string ](name='ServerIds', description='The IDs of the backend servers. You can specify up to 40 backend servers in each call.'),
  serverIps?: [ string ](name='ServerIps', description='The IP addresses of the backend servers. You can specify up to 40 backend servers in each call.'),
}

model ListServerGroupServersResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries returned per page.', example='20'),
  nextToken?: string(name='NextToken', description='The token that is used for the next query. Valid values:

*   If this is your first query or no next query is to be sent, ignore this parameter.
*   If a next query is to be sent, set the parameter to the value of NextToken that is returned from the last call.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server.', example='ECS'),
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **1** to **65535**.', example='80'),
      serverGroupId?: string(name='ServerGroupId', description='The ID of the server group.', example='sgp-atstuj3rtoptyui****'),
      serverId?: string(name='ServerId', description='The ID of the server group.', example='i-bp67acfmxazb4p****'),
      serverIp?: string(name='ServerIp', description='The IP address of the backend server.', example='192.168.2.1'),
      serverType?: string(name='ServerType', description='The type of backend server. Valid values:

*   **Ecs**: Elastic Compute Service (ECS) instance
*   **Eni**: elastic network interface (ENI)
*   **Eci**: elastic container instance
*   **Ip**: IP address', example='Ecs'),
      status?: string(name='Status', description='The status of the backend server. Valid values:

*   **Adding**
*   **Available**
*   **Configuring**
*   **Removing**', example='Available'),
      weight?: int32(name='Weight', description='The weight of the backend server.', example='100'),
      zoneId?: string(name='ZoneId', description='The zone ID of the server.', example='cn-hangzhou-a'),
    }
  ](name='Servers', description='The backend servers.'),
  totalCount?: int32(name='TotalCount', description='The number of entries returned.', example='10'),
}

model ListServerGroupServersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServerGroupServersResponseBody(name='body'),
}

/**
 * @summary Queries servers in a server group of a Network Load Balancer (NLB) instance.
 *
 * @param request ListServerGroupServersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServerGroupServersResponse
 */
async function listServerGroupServersWithOptions(request: ListServerGroupServersRequest, runtime: $RuntimeOptions): ListServerGroupServersResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.serverIds)) {
    body['ServerIds'] = request.serverIds;
  }
  if (!$isNull(request.serverIps)) {
    body['ServerIps'] = request.serverIps;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServerGroupServers',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries servers in a server group of a Network Load Balancer (NLB) instance.
 *
 * @param request ListServerGroupServersRequest
 * @return ListServerGroupServersResponse
 */
async function listServerGroupServers(request: ListServerGroupServersRequest): ListServerGroupServersResponse {
  var runtime = new $RuntimeOptions{};
  return listServerGroupServersWithOptions(request, runtime);
}

model ListServerGroupsRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**. Default value: **20**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token used in the next request to retrieve a new page of results. Valid values:

*   For the first request and last request, you do not need to specify this parameter.
*   You must specify the token obtained from the previous query as the value of NextToken.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the server group belongs.', example='rg-atstuj3rtop****'),
  serverGroupIds?: [ string ](name='ServerGroupIds', description='The server group IDs. You can specify up to 20 server group IDs in each call.'),
  serverGroupNames?: [ string ](name='ServerGroupNames', description='The names of the server groups to be queried. You can specify up to 20 names in each call.'),
  serverGroupType?: string(name='ServerGroupType', description='The type of server group. Valid values:

*   **Instance**: allows you to add servers of the **Ecs**, **Ens**, and **Eci** types.
*   **Ip**: allows you to add servers by specifying IP addresses.', example='Instance'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. You can specify up to 10 tag keys.

The tag key can be up to 64 characters in length. It cannot start with `aliyun` or `acs:` and cannot contain `http://` or `https://`.', example='Test'),
      value?: string(name='Value', description='The value of the tag. You can specify up to 10 tag values.

The tag value can be up to 128 characters in length. It cannot start with `aliyun` and `acs:`, and cannot contain `http://` or `https://`.', example='Test'),
    }
  ](name='Tag', description='The tags.'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) in which the server group is deployed.', example='vpc-bp15zckdt37pq72zv****'),
}

model ListServerGroupsResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page. Valid values: **1** to **100**.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B28E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroups?: [ 
    {
      addressIPVersion?: string(name='AddressIPVersion', description='The IP version. Valid values:

*   **ipv4**
*   **DualStack**', example='ipv4'),
      aliUid?: long(name='AliUid', description='The ID of the Alibaba Cloud account.', example='165820696622****'),
      anyPortEnabled?: boolean(name='AnyPortEnabled', description='Indicates whether the feature of forwarding requests to all ports is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Indicates whether connection draining is enabled. Valid values:

*   **true**
*   **false**', example='false'),
      connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='The timeout period of connection draining. Unit: seconds. Valid values: **10** to **900**.', example='200'),
      healthCheck?: {
        healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The backend port that is used for health checks.

Valid values: **0** to **65535**.

A value of **0** indicates that the port on a backend server is used for health checks.', example='200'),
        healthCheckConnectTimeout?: int32(name='HealthCheckConnectTimeout', description='The maximum timeout period of a health check response. Unit: seconds. Default value: **5**.

Valid values: **1** to **300**', example='200'),
        healthCheckDomain?: string(name='HealthCheckDomain', description='The domain name that you want to use for health checks. Valid values:

*   **$SERVER_IP**: the private IP address of a backend server.
*   **domain**: a specified domain name. The domain name must be 1 to 80 characters in length, and can contain lowercase letters, digits, hyphens (-), and periods (.).

> This parameter takes effect only when **HealthCheckType** is set to **HTTP**.', example='$SERVER_IP'),
        healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Indicates whether the health check feature is enabled. Valid values:

*   **true**
*   **false**', example='false'),
        healthCheckExp?: string(name='HealthCheckExp', description='The response string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits.', example='ok'),
        healthCheckHttpCode?: [ string ](name='HealthCheckHttpCode', description='The HTTP status codes returned for health checks. Multiple HTTP status codes are separated by commas (,). Valid values: **http_2xx**, **http_3xx**, **http_4xx**, and **http_5xx**.

> This parameter takes effect only when **HealthCheckType** is set to **HTTP**.'),
        healthCheckHttpVersion?: string(name='HealthCheckHttpVersion'),
        healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Default value: **5**.

*   If you set **HealthCheckType** to **TCP** or **HTTP**, valid values are **1 to 50**.
*   If you set **HealthCheckType** to **UDP**, valid values are **1 to 300**. Set the health check interval equal to or larger than the response timeout period to ensure that UDP response timeouts are not determined as no responses.', example='200'),
        healthCheckReq?: string(name='HealthCheckReq', description='The request string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits.', example='hello'),
        healthCheckType?: string(name='HealthCheckType', description='The protocol that is used for health checks. Valid values:

*   **TCP**
*   **HTTP**
*   **UDP**', example='TCP'),
        healthCheckUrl?: string(name='HealthCheckUrl', description='The path to which health check probes are sent.

> This parameter takes effect only when **HealthCheckType** is set to **HTTP**.', example='/test/index.html'),
        healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from **fail** to **success**.

Valid values: **2** to **10**.', example='2'),
        httpCheckMethod?: string(name='HttpCheckMethod', description='The HTTP method that is used for health checks. Valid values: **GET** and **HEAD**.

> This parameter takes effect only when **HealthCheckType** is set to **HTTP**.', example='GET'),
        unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from **success** to **fail**.

Valid values: **2** to **10**.', example='3'),
      }(name='HealthCheck', description='The configurations of health checks.'),
      preserveClientIpEnabled?: boolean(name='PreserveClientIpEnabled', description='Indicates whether client IP preservation is enabled. Valid values:

*   **true**
*   **false**

> This parameter is set to **true** by default when **AddressIPVersion** is set to **ipv4**. This parameter is set to **false** when **AddressIPVersion** is set to **ipv6**. **true** will be supported by later versions.', example='true'),
      protocol?: string(name='Protocol', description='The backend protocol. Valid values: **TCP** and **UDP**.', example='TCP'),
      regionId?: string(name='RegionId', description='The region ID of the NLB instance.', example='cn-hangzhou'),
      relatedLoadBalancerIds?: [ string ](name='RelatedLoadBalancerIds', description='The NLB instances.'),
      resourceGroupId?: string(name='ResourceGroupId', description='The ID of the resource group to which the server group belongs.', example='rg-atstuj3rtop****'),
      scheduler?: string(name='Scheduler', description='The routing algorithm. Valid values:

*   **Wrr**: Backend servers with higher weights receive more requests than backend servers with lower weights.
*   **rr**: Requests are forwarded to the backend servers in sequence. sch: Requests are forwarded to the backend servers based on source IP address hashing.
*   **sch**: Requests from the same source IP address are forwarded to the same backend server.
*   **tch**: Four-element hashing, which specifies consistent hashing that is based on four factors: source IP address, destination IP address, source port, and destination port. Requests that contain the same information based on the four factors are forwarded to the same backend server.
*   **qch**: QUIC ID hashing. Requests that contain the same QUIC ID are forwarded to the same backend server.', example='Wrr'),
      serverCount?: int32(name='ServerCount', description='The number of server groups associated with the NLB instances.', example='2'),
      serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-atstuj3rtoptyui****'),
      serverGroupName?: string(name='ServerGroupName', description='The server group name.', example='NLB_ServerGroup'),
      serverGroupStatus?: string(name='ServerGroupStatus', description='The status of the server group. Valid values:

*   **Creating**
*   **Available**
*   **Configuring**', example='Available'),
      serverGroupType?: string(name='ServerGroupType', description='The type of server group. Valid values:

*   **Instance** : contains servers of the **Ecs**, **Ens**, and **Eci** types.
*   **Ip**: contains servers specified by IP addresses.', example='Instance'),
      tags?: [ 
        {
          key?: string(name='Key', description='The tag key. At most 10 tag keys are returned.

The tag key can be up to 64 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
          value?: string(name='Value', description='The tag value. At most 10 tag values are returned.

The tag value can be up to 128 characters in length, and cannot contain `http://` or `https://`. It cannot start with `aliyun` or `acs:`.', example='Test'),
        }
      ](name='Tags', description='The tag.'),
      vpcId?: string(name='VpcId', description='The ID of the VPC to which the server group belongs.', example='vpc-bp15zckdt37pq72zv****'),
    }
  ](name='ServerGroups', description='A list of server groups.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='1'),
}

model ListServerGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListServerGroupsResponseBody(name='body'),
}

/**
 * @summary Queries the server groups of a Network Load Balancer (NLB) instance.
 *
 * @param request ListServerGroupsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListServerGroupsResponse
 */
async function listServerGroupsWithOptions(request: ListServerGroupsRequest, runtime: $RuntimeOptions): ListServerGroupsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.tag)) {
    query['Tag'] = request.tag;
  }
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceGroupId)) {
    body['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!$isNull(request.serverGroupIds)) {
    body['ServerGroupIds'] = request.serverGroupIds;
  }
  if (!$isNull(request.serverGroupNames)) {
    body['ServerGroupNames'] = request.serverGroupNames;
  }
  if (!$isNull(request.serverGroupType)) {
    body['ServerGroupType'] = request.serverGroupType;
  }
  if (!$isNull(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListServerGroups',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the server groups of a Network Load Balancer (NLB) instance.
 *
 * @param request ListServerGroupsRequest
 * @return ListServerGroupsResponse
 */
async function listServerGroups(request: ListServerGroupsRequest): ListServerGroupsResponse {
  var runtime = new $RuntimeOptions{};
  return listServerGroupsWithOptions(request, runtime);
}

model ListSystemSecurityPolicyRequest {
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model ListSystemSecurityPolicyResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='5C057647-284B-5C67-A07E-4B8F3DABA9F9'),
  securityPolicies?: [ 
    {
      ciphers?: string(name='Ciphers', description='The cipher suite.', example='ECDHE-ECDSA-AES128-GCM-SHA256,ECDHE-ECDSA-AES256-GCM-SHA384,ECDHE-ECDSA-AES128-SHA256,ECDHE-ECDSA-AES256-SHA384,ECDHE-RSA-AES128-GCM-SHA256,ECDHE-RSA-AES256-GCM-SHA384,ECDHE-RSA-AES128-SHA256,ECDHE-RSA-AES256-SHA384,AES128-GCM-SHA256,AES256-GCM-SHA384,AES128-SHA256,AES256-SHA256,ECDHE-ECDSA-AES128-SHA,ECDHE-ECDSA-AES256-SHA,ECDHE-RSA-AES128-SHA,ECDHE-RSA-AES256-SHA,AES128-SHA,AES256-SHA,DES-CBC3-SHA'),
      securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.', example='sp-3fdab6dkkke10s****'),
      securityPolicyName?: string(name='SecurityPolicyName', description='The name of the TLS security policy.', example='test'),
      tlsVersion?: string(name='TlsVersion', description='The TLS version.', example='TLSv1.0'),
    }
  ](name='SecurityPolicies', description='A list of TLS security policies.'),
}

model ListSystemSecurityPolicyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListSystemSecurityPolicyResponseBody(name='body'),
}

/**
 * @summary Queries the default TLS policy.
 *
 * @param request ListSystemSecurityPolicyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListSystemSecurityPolicyResponse
 */
async function listSystemSecurityPolicyWithOptions(request: ListSystemSecurityPolicyRequest, runtime: $RuntimeOptions): ListSystemSecurityPolicyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListSystemSecurityPolicy',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the default TLS policy.
 *
 * @param request ListSystemSecurityPolicyRequest
 * @return ListSystemSecurityPolicyResponse
 */
async function listSystemSecurityPolicy(request: ListSystemSecurityPolicyRequest): ListSystemSecurityPolicyResponse {
  var runtime = new $RuntimeOptions{};
  return listSystemSecurityPolicyWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  maxResults?: int32(name='MaxResults', description='The number of entries to return in each call. Valid values: **1** to **50**. Default value: **50**.', example='20'),
  nextToken?: string(name='NextToken', description='The pagination token used to specify a particular page of results. Valid values:

*   Leave this parameter empty for the first query or the only query.
*   Set this parameter to the value of NextToken obtained from the previous query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  regionId?: string(name='RegionId', description='You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources.'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **loadbalancer**: the Network Load Balancer (NLB) instance
*   **securitypolicy**: the security policy
*   **servergroup**: the server group
*   **listener**: the listener

This parameter is required.', example='loadbalancer'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`.', example='env'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`.', example='product'),
    }
  ](name='Tag', description='The tags'),
}

model ListTagResourcesResponseBody = {
  maxResults?: int32(name='MaxResults', description='The number of entries per page.', example='20'),
  nextToken?: string(name='NextToken', description='A pagination token. It can be used in the next request to retrieve a new page of results. Valid values:

*   If **NextToken** is empty, no next page exists.
*   If a value is returned for **NextToken**, the value is the token that determines the start point of the next query.', example='FFmyTO70tTpLG6I3FmYAXGKPd****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  tagResources?: [ 
    {
      aliUid?: long(name='AliUid', description='The UID of the Alibaba Cloud account.', example='1429****39299349'),
      category?: string(name='Category', description='The type of the tag. Valid values:

*   **Custom**
*   **System**
*   **All**', example='All'),
      regionNo?: string(name='RegionNo', description='The region information.', example='cn-hangzhou'),
      resourceId?: string(name='ResourceId', description='The resource ID.', example='nlb-nrnrxwd15en27r****'),
      resourceType?: string(name='ResourceType', description='The type of resource. Valid values:

*   **loadbalancer**: an NLB instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group', example='loadbalancer'),
      scope?: string(name='Scope', description='The visible range of the tags.', example='public'),
      tagKey?: string(name='TagKey', description='The tag key.', example='env'),
      tagValue?: string(name='TagValue', description='The tag value.', example='product'),
    }
  ](name='TagResources', description='The details about the resource and its tags, including the resource ID, the resource type, and the keys and values of the tags.'),
  totalCount?: int32(name='TotalCount', description='The total number of entries returned.', example='10'),
}

model ListTagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTagResourcesResponseBody(name='body'),
}

/**
 * @summary Queries the tags of a resource.
 *
 * @param request ListTagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTagResourcesResponse
 */
async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: $RuntimeOptions): ListTagResourcesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.maxResults)) {
    body['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    body['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.resourceId)) {
    bodyFlat['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    bodyFlat['Tag'] = request.tag;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListTagResources',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Queries the tags of a resource.
 *
 * @param request ListTagResourcesRequest
 * @return ListTagResourcesResponse
 */
async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model LoadBalancerJoinSecurityGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: prechecks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance which you want to add to a security group.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The security group ID of the instance.

This parameter is required.'),
}

model LoadBalancerJoinSecurityGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model LoadBalancerJoinSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoadBalancerJoinSecurityGroupResponseBody(name='body'),
}

/**
 * @summary Associates a security group with a Network Load Balancer (NLB) instance.
 *
 * @description *   Make sure that you have created a security group. For more information about how to create a security group, see [CreateSecurityGroup](https://help.aliyun.com/document_detail/25553.html).
 * *   An NLB instance can be associated with up to four security groups.
 * *   You can query the security groups that are associated with an NLB instance by calling the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation.
 * *   LoadBalancerJoinSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the status of a task.
 *     *   If the task is in the **Succeeded** state, the security group is associated.
 *     *   If the task is in the **Processing** state, the security group is being associated. In this case, you can perform only query operations.
 *
 * @param request LoadBalancerJoinSecurityGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LoadBalancerJoinSecurityGroupResponse
 */
async function loadBalancerJoinSecurityGroupWithOptions(request: LoadBalancerJoinSecurityGroupRequest, runtime: $RuntimeOptions): LoadBalancerJoinSecurityGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityGroupIds)) {
    body['SecurityGroupIds'] = request.securityGroupIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'LoadBalancerJoinSecurityGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Associates a security group with a Network Load Balancer (NLB) instance.
 *
 * @description *   Make sure that you have created a security group. For more information about how to create a security group, see [CreateSecurityGroup](https://help.aliyun.com/document_detail/25553.html).
 * *   An NLB instance can be associated with up to four security groups.
 * *   You can query the security groups that are associated with an NLB instance by calling the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/214362.html) operation.
 * *   LoadBalancerJoinSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the status of a task.
 *     *   If the task is in the **Succeeded** state, the security group is associated.
 *     *   If the task is in the **Processing** state, the security group is being associated. In this case, you can perform only query operations.
 *
 * @param request LoadBalancerJoinSecurityGroupRequest
 * @return LoadBalancerJoinSecurityGroupResponse
 */
async function loadBalancerJoinSecurityGroup(request: LoadBalancerJoinSecurityGroupRequest): LoadBalancerJoinSecurityGroupResponse {
  var runtime = new $RuntimeOptions{};
  return loadBalancerJoinSecurityGroupWithOptions(request, runtime);
}

model LoadBalancerLeaveSecurityGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: checks the request without performing the operation. The system checks the required parameters, request syntax, and limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  securityGroupIds?: [ string ](name='SecurityGroupIds', description='The ID of the security group to be disassociated.

This parameter is required.'),
}

model LoadBalancerLeaveSecurityGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model LoadBalancerLeaveSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LoadBalancerLeaveSecurityGroupResponseBody(name='body'),
}

/**
 * @summary Disassociates a Network Load Balancer (NLB) instance from a security group.
 *
 * @description LoadBalancerLeaveSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the status of a task.
 * *   If the task is in the **Succeeded** state, the security group is disassociated.
 * *   If the task is in the **Processing** state, the security group is being disassociated. In this case, you can perform only query operations.
 *
 * @param request LoadBalancerLeaveSecurityGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LoadBalancerLeaveSecurityGroupResponse
 */
async function loadBalancerLeaveSecurityGroupWithOptions(request: LoadBalancerLeaveSecurityGroupRequest, runtime: $RuntimeOptions): LoadBalancerLeaveSecurityGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityGroupIds)) {
    body['SecurityGroupIds'] = request.securityGroupIds;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'LoadBalancerLeaveSecurityGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Disassociates a Network Load Balancer (NLB) instance from a security group.
 *
 * @description LoadBalancerLeaveSecurityGroup is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the status of a task.
 * *   If the task is in the **Succeeded** state, the security group is disassociated.
 * *   If the task is in the **Processing** state, the security group is being disassociated. In this case, you can perform only query operations.
 *
 * @param request LoadBalancerLeaveSecurityGroupRequest
 * @return LoadBalancerLeaveSecurityGroupResponse
 */
async function loadBalancerLeaveSecurityGroup(request: LoadBalancerLeaveSecurityGroupRequest): LoadBalancerLeaveSecurityGroupResponse {
  var runtime = new $RuntimeOptions{};
  return loadBalancerLeaveSecurityGroupWithOptions(request, runtime);
}

model MoveResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group.

This parameter is required.', example='rg-aekzjcnrv3vvqhq'),
  regionId?: string(name='RegionId', description='The region ID of the resource.

This parameter is required.', example='cn-hangzhou'),
  resourceId?: string(name='ResourceId', description='The ID of the resource.

This parameter is required.', example='nlb-nrnrxwd15en27r****'),
  resourceType?: string(name='ResourceType', description='The type of resource. Valid values:

*   **loadbalancer**: a Network Load Balancer (NLB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
}

model MoveResourceGroupResponseBody = {
  data?: {
    resourceId?: string(name='ResourceId', description='The ID of the resource. You can specify up to 50 resource IDs in each call.', example='nlb-nrnrxwd15en27r****'),
  }(name='Data', description='The data returned.'),
  httpStatusCode?: int32(name='HttpStatusCode', description='The HTTP status code returned.', example='200'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
  success?: boolean(name='Success', description='Indicates whether the request was successful. Valid values:

*   **true**
*   **false**', example='true'),
}

model MoveResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MoveResourceGroupResponseBody(name='body'),
}

/**
 * @summary Modify the group of resource.
 *
 * @param request MoveResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroupWithOptions(request: MoveResourceGroupRequest, runtime: $RuntimeOptions): MoveResourceGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.newResourceGroupId)) {
    body['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.resourceId)) {
    body['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'MoveResourceGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modify the group of resource.
 *
 * @param request MoveResourceGroupRequest
 * @return MoveResourceGroupResponse
 */
async function moveResourceGroup(request: MoveResourceGroupRequest): MoveResourceGroupResponse {
  var runtime = new $RuntimeOptions{};
  return moveResourceGroupWithOptions(request, runtime);
}

model RemoveServersFromServerGroupRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtoptyui****'),
  servers?: [ 
    {
      port?: int32(name='Port', description='The port that is used by the backend server. Valid values: **0** to **65535**. If you do not set this parameter, the default value **0** is used.', example='443', nullable=true),
      serverId?: string(name='ServerId', description='The backend server ID.

*   If the server group is of the **Instance** type, set this parameter to the IDs of servers of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set ServerId to IP addresses.

This parameter is required.', example='ecs-bp67acfmxazb4p****'),
      serverIp?: string(name='ServerIp', description='The IP addresses of the server. If the server group type is **Ip**, set the ServerId parameter to IP addresses.', example='192.168.6.6'),
      serverType?: string(name='ServerType', description='The type of the backend server. Valid values:

*   **Ecs**: the Elastic Compute Service (ECS) instance
*   **Eni**: the elastic network interface (ENI)
*   **Eci**: the elastic container instance
*   **Ip**: the IP address

This parameter is required.', example='Ecs'),
    }
  ](name='Servers', description='The backend servers. You can specify up to 200 backend servers in each call.

This parameter is required.'),
}

model RemoveServersFromServerGroupResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-atstuj3rtoptyui****'),
}

model RemoveServersFromServerGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveServersFromServerGroupResponseBody(name='body'),
}

/**
 * @summary Deletes server groups from a Network Load Balancer (NLB) instance.
 *
 * @param request RemoveServersFromServerGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveServersFromServerGroupResponse
 */
async function removeServersFromServerGroupWithOptions(request: RemoveServersFromServerGroupRequest, runtime: $RuntimeOptions): RemoveServersFromServerGroupResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.servers)) {
    body['Servers'] = request.servers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveServersFromServerGroup',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Deletes server groups from a Network Load Balancer (NLB) instance.
 *
 * @param request RemoveServersFromServerGroupRequest
 * @return RemoveServersFromServerGroupResponse
 */
async function removeServersFromServerGroup(request: RemoveServersFromServerGroupRequest): RemoveServersFromServerGroupResponse {
  var runtime = new $RuntimeOptions{};
  return removeServersFromServerGroupWithOptions(request, runtime);
}

model SetHdMonitorRegionConfigRequest {
  logProject?: string(name='LogProject', description='The name of the Log Service project.

This parameter is required.', example='hdmonitor-cn-hangzhou-223794579283657556'),
  metricStore?: string(name='MetricStore', description='The name of the MetricStore in Simple Log Service.

This parameter is required.', example='hdmonitor-cn-hangzhou-metricStore-1'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/2399192.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model SetHdMonitorRegionConfigResponseBody = {
  logProject?: string(name='LogProject', description='The name of the Log Service project.', example='hdmonitor-cn-hangzhou-223794579283657556'),
  metricStore?: string(name='MetricStore', description='The name of the MetricStore in Simple Log Service.', example='hdmonitor-cn-hangzhou-metricStore-1'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/2399192.html) operation to query the most recent region list.', example='cn-hangzhou'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model SetHdMonitorRegionConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetHdMonitorRegionConfigResponseBody(name='body'),
}

/**
 * @summary Configures storage for fine-grained monitoring.
 *
 * @description This operation is used to configure a data warehouse for the fine-grained monitoring feature. If a listener in the current region has fine-grained monitoring enabled, you must disable fine-grained monitoring before you can configure a warehouse.
 *
 * @param request SetHdMonitorRegionConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetHdMonitorRegionConfigResponse
 */
async function setHdMonitorRegionConfigWithOptions(request: SetHdMonitorRegionConfigRequest, runtime: $RuntimeOptions): SetHdMonitorRegionConfigResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.logProject)) {
    query['LogProject'] = request.logProject;
  }
  if (!$isNull(request.metricStore)) {
    query['MetricStore'] = request.metricStore;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetHdMonitorRegionConfig',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Configures storage for fine-grained monitoring.
 *
 * @description This operation is used to configure a data warehouse for the fine-grained monitoring feature. If a listener in the current region has fine-grained monitoring enabled, you must disable fine-grained monitoring before you can configure a warehouse.
 *
 * @param request SetHdMonitorRegionConfigRequest
 * @return SetHdMonitorRegionConfigResponse
 */
async function setHdMonitorRegionConfig(request: SetHdMonitorRegionConfigRequest): SetHdMonitorRegionConfigResponse {
  var runtime = new $RuntimeOptions{};
  return setHdMonitorRegionConfigWithOptions(request, runtime);
}

model StartListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model StartListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model StartListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartListenerResponseBody(name='body'),
}

/**
 * @summary Enables a Network Load Balancer (NLB) listener.
 *
 * @param request StartListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartListenerResponse
 */
async function startListenerWithOptions(request: StartListenerRequest, runtime: $RuntimeOptions): StartListenerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables a Network Load Balancer (NLB) listener.
 *
 * @param request StartListenerRequest
 * @return StartListenerResponse
 */
async function startListener(request: StartListenerRequest): StartListenerResponse {
  var runtime = new $RuntimeOptions{};
  return startListenerWithOptions(request, runtime);
}

model StartShiftLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  zoneMappings?: [ 
    {
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone uses one vSwitch and one subnet.

This parameter is required.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the NLB instance.

>  You can remove only one IP address (or zone) in each call.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches.

>  You can remove only one IP address (or zone) in each call.

This parameter is required.'),
}

model StartShiftLoadBalancerZonesResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model StartShiftLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartShiftLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Removes the elastic IP address (EIP) or virtual IP address (VIP) used in a zone from the DNS record.
 *
 * @description >  If the NLB instance is deployed in only one zone, you cannot remove the EIP or VIP from the DNS record.
 *
 * @param request StartShiftLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartShiftLoadBalancerZonesResponse
 */
async function startShiftLoadBalancerZonesWithOptions(request: StartShiftLoadBalancerZonesRequest, runtime: $RuntimeOptions): StartShiftLoadBalancerZonesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.zoneMappings)) {
    body['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'StartShiftLoadBalancerZones',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes the elastic IP address (EIP) or virtual IP address (VIP) used in a zone from the DNS record.
 *
 * @description >  If the NLB instance is deployed in only one zone, you cannot remove the EIP or VIP from the DNS record.
 *
 * @param request StartShiftLoadBalancerZonesRequest
 * @return StartShiftLoadBalancerZonesResponse
 */
async function startShiftLoadBalancerZones(request: StartShiftLoadBalancerZonesRequest): StartShiftLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return startShiftLoadBalancerZonesWithOptions(request, runtime);
}

model StopListenerRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs a dry run without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@80'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model StopListenerResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model StopListenerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopListenerResponseBody(name='body'),
}

/**
 * @summary Stops a listener of a Network Load Balancer (NLB) instance.
 *
 * @param request StopListenerRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StopListenerResponse
 */
async function stopListenerWithOptions(request: StopListenerRequest, runtime: $RuntimeOptions): StopListenerResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'StopListener',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Stops a listener of a Network Load Balancer (NLB) instance.
 *
 * @param request StopListenerRequest
 * @return StopListenerResponse
 */
async function stopListener(request: StopListenerRequest): StopListenerResponse {
  var runtime = new $RuntimeOptions{};
  return stopListenerWithOptions(request, runtime);
}

model TagResourcesRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The ID of the region where the resources are deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The IDs of the resources. You can specify up to 50 resource IDs in each call.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The type of the resources. Valid values:

*   **loadbalancer**: the Network Load Balancer (NLB) instance
*   **securitypolicy**: the security policy
*   **servergroup**: the server group

This parameter is required.', example='loadbalancer'),
  tag?: [ 
    {
      key?: string(name='Key', description='The key of the tag. The tag key can be up to 64 characters in length, cannot start with `aliyun` or `acs:`, and cannot contain `http://` or `https://`. The tag key can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='env'),
      value?: string(name='Value', description='The value of the tag. The tag value can be up to 128 characters in length, cannot start with `acs:` or `aliyun`, and cannot contain `http://` or `https://`. The tag value can contain letters, digits, and the following special characters: _ . : / = + - @

You can specify up to 20 tags in each call.', example='product'),
    }
  ](name='Tag', description='The tags.

This parameter is required.'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model TagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesResponseBody(name='body'),
}

/**
 * @summary Adds tags to specified resources.
 *
 * @param request TagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TagResourcesResponse
 */
async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: $RuntimeOptions): TagResourcesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.resourceId)) {
    bodyFlat['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tag)) {
    bodyFlat['Tag'] = request.tag;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'TagResources',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Adds tags to specified resources.
 *
 * @param request TagResourcesRequest
 * @return TagResourcesResponse
 */
async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All', description='Specifies whether to remove all tags from the specified resource. Valid values:

*   **true**: removes all tags from the specified resource.
*   **false** (default): does not remove all tags from the specified resource.', example='false'),
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system automatically uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='true'),
  regionId?: string(name='RegionId', description='The region ID of the resource.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  resourceId?: [ string ](name='ResourceId', description='The ID of the resource. You can specify at most 50 resource IDs in each call.

This parameter is required.'),
  resourceType?: string(name='ResourceType', description='The type of the resource. Valid values:

*   **loadbalancer**: a Network Load Balancer (NLB) instance
*   **securitypolicy**: a security policy
*   **servergroup**: a server group

This parameter is required.', example='loadbalancer'),
  tagKey?: [ string ](name='TagKey', description='The keys of the tags that you want to remove. You can remove at most 20 tags in each call.'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
}

model UntagResourcesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UntagResourcesResponseBody(name='body'),
}

/**
 * @summary Removes tags from resources.
 *
 * @param request UntagResourcesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UntagResourcesResponse
 */
async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: $RuntimeOptions): UntagResourcesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.all)) {
    body['All'] = request.all;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.resourceId)) {
    bodyFlat['ResourceId'] = request.resourceId;
  }
  if (!$isNull(request.resourceType)) {
    body['ResourceType'] = request.resourceType;
  }
  if (!$isNull(request.tagKey)) {
    bodyFlat['TagKey'] = request.tagKey;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UntagResources',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Removes tags from resources.
 *
 * @param request UntagResourcesRequest
 * @return UntagResourcesResponse
 */
async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new $RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpdateListenerAttributeRequest {
  alpnEnabled?: boolean(name='AlpnEnabled', description='Specifies whether to enable Application-Layer Protocol Negotiation (ALPN). Valid values:

*   **true**
*   **false**', example='false'),
  alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**: uses only HTTP 1.x. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0.
*   **HTTP2Only**: uses only HTTP 2.0.
*   **HTTP2Optional**: preferentially uses HTTP 1.x over HTTP 2.0. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0, and the priority of HTTP 1.0 is higher than the priority of HTTP 2.0.
*   **HTTP2Preferred**: preferentially uses HTTP 2.0 over HTTP 1.x. The priority of HTTP 2.0 is higher than the priority of HTTP 1.1, and the priority of HTTP 1.1 is higher than the priority of HTTP 1.0.

>  This parameter is required if AlpnEnabled is set to true.', example='HTTP1Only', nullable=true),
  caCertificateIds?: [ string ](name='CaCertificateIds', description='The CA certificate. You can specify only one CA certificate.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**
*   **false**', example='false'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificate. Only one server certificate is supported.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='10000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period for idle connections. Unit: seconds

*   If the listener uses **TCP** or **TCPSSL**, you can set this parameter to a value ranging from **10** to **900**. Default value: **900**
*   If the listener uses **UDP**, you can set this parameter to a value ranging from **10** to **20**. Default value: **20**', example='900'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcpssl_443'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@443'),
  mss?: int32(name='Mss', description='The size of the largest TCP packet segment. Unit: bytes. Valid values: **0** to **1500**. **0** indicates that the maximum segment size (MSS) remains unchanged. This parameter is supported only by TCP listeners and listeners that use SSL over TCP.', example='344'),
  proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Specifies whether to use the Proxy protocol to pass the client IP address to the backend server. Valid values:

*   **true**
*   **false**', example='false'),
  proxyProtocolV2Config?: {
    ppv2PrivateLinkEpIdEnabled?: boolean(name='Ppv2PrivateLinkEpIdEnabled', description='Specifies whether to use the Proxy protocol to pass the PrivateLinkEpId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
    ppv2PrivateLinkEpsIdEnabled?: boolean(name='Ppv2PrivateLinkEpsIdEnabled', description='Specifies whether to use the Proxy protocol to pass the PrivateLinkEpsId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
    ppv2VpcIdEnabled?: boolean(name='Ppv2VpcIdEnabled', description='Specifies whether to use the Proxy protocol to pass the VpcId parameter to backend servers. Valid values:

*   **true**
*   **false**', example='false'),
  }(name='ProxyProtocolV2Config', description='Specifies that the Proxy protocol passes the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  secSensorEnabled?: boolean(name='SecSensorEnabled', description='Specifies whether to enable fine-grained monitoring. Valid values:

*   **true**
*   **false**', example='false'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.

>  This parameter takes effect only for listeners that use SSL over TCP.', example='tls_cipher_policy_1_1'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

> 

*   If the listener uses **TCP**, you can specify server groups whose protocol is **TCP** or **TCP_UDP**. **UDP** server groups are not supported.

*   If the listener uses **UDP**, you can specify server groups whose protocol is **UDP** or **TCP_UDP**. **TCP** server groups are not supported.

*   If the listener uses **TCPSSL**, you can specify server groups whose protocol is **TCP** and whose **client IP preservation is disabled**. **TCP** server groups for which **client IP preservation is enabled** and server groups whose protocol is **UDP** or **TCP_UDP** are not supported.', example='sgp-ppdpc14gdm3x4o****'),
}

model UpdateListenerAttributeShrinkRequest {
  alpnEnabled?: boolean(name='AlpnEnabled', description='Specifies whether to enable Application-Layer Protocol Negotiation (ALPN). Valid values:

*   **true**
*   **false**', example='false'),
  alpnPolicy?: string(name='AlpnPolicy', description='The ALPN policy. Valid values:

*   **HTTP1Only**: uses only HTTP 1.x. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0.
*   **HTTP2Only**: uses only HTTP 2.0.
*   **HTTP2Optional**: preferentially uses HTTP 1.x over HTTP 2.0. The priority of HTTP 1.1 is higher than the priority of HTTP 1.0, and the priority of HTTP 1.0 is higher than the priority of HTTP 2.0.
*   **HTTP2Preferred**: preferentially uses HTTP 2.0 over HTTP 1.x. The priority of HTTP 2.0 is higher than the priority of HTTP 1.1, and the priority of HTTP 1.1 is higher than the priority of HTTP 1.0.

>  This parameter is required if AlpnEnabled is set to true.', example='HTTP1Only', nullable=true),
  caCertificateIds?: [ string ](name='CaCertificateIds', description='The CA certificate. You can specify only one CA certificate.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  caEnabled?: boolean(name='CaEnabled', description='Specifies whether to enable mutual authentication. Valid values:

*   **true**
*   **false**', example='false'),
  certificateIds?: [ string ](name='CertificateIds', description='The server certificate. Only one server certificate is supported.

>  This parameter takes effect only for listeners that use SSL over TCP.'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second supported by the listener in each zone (virtual IP address). Valid values: **0** to **1000000**. **0** indicates that the number of connections is unlimited.', example='10000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  idleTimeout?: int32(name='IdleTimeout', description='The timeout period for idle connections. Unit: seconds

*   If the listener uses **TCP** or **TCPSSL**, you can set this parameter to a value ranging from **10** to **900**. Default value: **900**
*   If the listener uses **UDP**, you can set this parameter to a value ranging from **10** to **20**. Default value: **20**', example='900'),
  listenerDescription?: string(name='ListenerDescription', description='The name of the listener.

The name must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at signs (@), underscores (_), and hyphens (-).', example='tcpssl_443'),
  listenerId?: string(name='ListenerId', description='The listener ID.

This parameter is required.', example='lsn-bp1bpn0kn908w4nbw****@443'),
  mss?: int32(name='Mss', description='The size of the largest TCP packet segment. Unit: bytes. Valid values: **0** to **1500**. **0** indicates that the maximum segment size (MSS) remains unchanged. This parameter is supported only by TCP listeners and listeners that use SSL over TCP.', example='344'),
  proxyProtocolEnabled?: boolean(name='ProxyProtocolEnabled', description='Specifies whether to use the Proxy protocol to pass the client IP address to the backend server. Valid values:

*   **true**
*   **false**', example='false'),
  proxyProtocolV2ConfigShrink?: string(name='ProxyProtocolV2Config', description='Specifies that the Proxy protocol passes the VpcId, PrivateLinkEpId, and PrivateLinkEpsId parameters to backend servers.'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  secSensorEnabled?: boolean(name='SecSensorEnabled', description='Specifies whether to enable fine-grained monitoring. Valid values:

*   **true**
*   **false**', example='false'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the security policy.

>  This parameter takes effect only for listeners that use SSL over TCP.', example='tls_cipher_policy_1_1'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

> 

*   If the listener uses **TCP**, you can specify server groups whose protocol is **TCP** or **TCP_UDP**. **UDP** server groups are not supported.

*   If the listener uses **UDP**, you can specify server groups whose protocol is **UDP** or **TCP_UDP**. **TCP** server groups are not supported.

*   If the listener uses **TCPSSL**, you can specify server groups whose protocol is **TCP** and whose **client IP preservation is disabled**. **TCP** server groups for which **client IP preservation is enabled** and server groups whose protocol is **UDP** or **TCP_UDP** are not supported.', example='sgp-ppdpc14gdm3x4o****'),
}

model UpdateListenerAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateListenerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateListenerAttributeResponseBody(name='body'),
}

/**
 * @summary Updates the attributes of a listener, such as the name and the idle connection timeout period.
 *
 * @param tmpReq UpdateListenerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateListenerAttributeResponse
 */
async function updateListenerAttributeWithOptions(tmpReq: UpdateListenerAttributeRequest, runtime: $RuntimeOptions): UpdateListenerAttributeResponse {
  tmpReq.validate();
  var request = new UpdateListenerAttributeShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.proxyProtocolV2Config)) {
    request.proxyProtocolV2ConfigShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.proxyProtocolV2Config, 'ProxyProtocolV2Config', 'json');
  }
  var body : map[string]any = {};
  if (!$isNull(request.alpnEnabled)) {
    body['AlpnEnabled'] = request.alpnEnabled;
  }
  if (!$isNull(request.alpnPolicy)) {
    body['AlpnPolicy'] = request.alpnPolicy;
  }
  if (!$isNull(request.caCertificateIds)) {
    body['CaCertificateIds'] = request.caCertificateIds;
  }
  if (!$isNull(request.caEnabled)) {
    body['CaEnabled'] = request.caEnabled;
  }
  if (!$isNull(request.certificateIds)) {
    body['CertificateIds'] = request.certificateIds;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.cps)) {
    body['Cps'] = request.cps;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.idleTimeout)) {
    body['IdleTimeout'] = request.idleTimeout;
  }
  if (!$isNull(request.listenerDescription)) {
    body['ListenerDescription'] = request.listenerDescription;
  }
  if (!$isNull(request.listenerId)) {
    body['ListenerId'] = request.listenerId;
  }
  if (!$isNull(request.mss)) {
    body['Mss'] = request.mss;
  }
  if (!$isNull(request.proxyProtocolEnabled)) {
    body['ProxyProtocolEnabled'] = request.proxyProtocolEnabled;
  }
  if (!$isNull(request.proxyProtocolV2ConfigShrink)) {
    body['ProxyProtocolV2Config'] = request.proxyProtocolV2ConfigShrink;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.secSensorEnabled)) {
    body['SecSensorEnabled'] = request.secSensorEnabled;
  }
  if (!$isNull(request.securityPolicyId)) {
    body['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateListenerAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the attributes of a listener, such as the name and the idle connection timeout period.
 *
 * @param request UpdateListenerAttributeRequest
 * @return UpdateListenerAttributeResponse
 */
async function updateListenerAttribute(request: UpdateListenerAttributeRequest): UpdateListenerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateListenerAttributeWithOptions(request, runtime);
}

model UpdateLoadBalancerAddressTypeConfigRequest {
  addressType?: string(name='AddressType', description='The new network type. Valid values:

*   **Internet**: The NLB instance uses a public IP address. The domain name of the NLB instance is resolved to the public IP address. The NLB instance is accessible over the Internet.
*   **Intranet**: The NLB instance uses a private IP address. The domain name of the NLB instance is resolved to the private IP address. The NLB instance can be accessed over the virtual private cloud (VPC) where the NLB instance is deployed.

This parameter is required.', example='Internet'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  zoneMappings?: [ 
    {
      allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP).', example='eip-bp1aedxso6u80u0qf****'),
      eipType?: string(name='EipType', description='The type of the EIP. Valid values:

*   **Common**: an EIP
*   **Anycast**: an Anycast EIP

>  This parameter is required only if **AddressType** is set to **Internet**.', example='Common'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. You can specify only one vSwitch (subnet) in each zone of an NLB instance.', example='vsw-bp10ttov87felojcn****'),
      zoneId?: string(name='ZoneId', description='The zone ID of the NLB instance.

You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between zones and vSwitches. You can specify up to 10 zones.'),
}

model UpdateLoadBalancerAddressTypeConfigResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateLoadBalancerAddressTypeConfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerAddressTypeConfigResponseBody(name='body'),
}

/**
 * @summary Changes the network type of the IPv4 address for a Network Load Balancer (NLB) instance.
 *
 * @description *   Make sure that an NLB instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/445868.html).
 * *   You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the **AddressType** value of an NLB instance after you change the network type.
 * *   **UpdateLoadBalancerAddressTypeConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the task status:
 *     *   If the task is in the **Succeeded** state, the network type of the IPv4 address of the NLB instance is changed.
 *     *   If the task is in the **Processing** state, the network type of the IPv4 address of the NLB instance is being changed. In this case, you can perform only query operations.
 *
 * @param request UpdateLoadBalancerAddressTypeConfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerAddressTypeConfigResponse
 */
async function updateLoadBalancerAddressTypeConfigWithOptions(request: UpdateLoadBalancerAddressTypeConfigRequest, runtime: $RuntimeOptions): UpdateLoadBalancerAddressTypeConfigResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.addressType)) {
    body['AddressType'] = request.addressType;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.zoneMappings)) {
    body['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerAddressTypeConfig',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Changes the network type of the IPv4 address for a Network Load Balancer (NLB) instance.
 *
 * @description *   Make sure that an NLB instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/445868.html).
 * *   You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the **AddressType** value of an NLB instance after you change the network type.
 * *   **UpdateLoadBalancerAddressTypeConfig** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation to query the task status:
 *     *   If the task is in the **Succeeded** state, the network type of the IPv4 address of the NLB instance is changed.
 *     *   If the task is in the **Processing** state, the network type of the IPv4 address of the NLB instance is being changed. In this case, you can perform only query operations.
 *
 * @param request UpdateLoadBalancerAddressTypeConfigRequest
 * @return UpdateLoadBalancerAddressTypeConfigResponse
 */
async function updateLoadBalancerAddressTypeConfig(request: UpdateLoadBalancerAddressTypeConfigRequest): UpdateLoadBalancerAddressTypeConfigResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerAddressTypeConfigWithOptions(request, runtime);
}

model UpdateLoadBalancerAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. The client token can contain only ASCII characters.

>  If you do not specify this parameter, the system uses the **request ID** as the **client token**. The **request ID** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  cps?: int32(name='Cps', description='The maximum number of new connections per second in each zone supported by the NLB instance (virtual IP address). Valid values: **1** to **1000000**.', example='1'),
  crossZoneEnabled?: boolean(name='CrossZoneEnabled', description='Specifies whether to enable cross-zone load balancing for the NLB instance. Valid values:

*   **true**
*   **false**', example='false'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The NLB instance ID.

This parameter is required.', example='nlb-wb7r6dlwetvt5j****'),
  loadBalancerName?: string(name='LoadBalancerName', description='The NLB instance name.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter.', example='NLB1'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-beijing'),
}

model UpdateLoadBalancerAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='aab74cfa-3bc4-48fc-80fc-0101da5a****'),
  requestId?: string(name='RequestId', description='The request ID.', example='7294679F-08DE-16D4-8E5D-1625685DC10B'),
}

model UpdateLoadBalancerAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerAttributeResponseBody(name='body'),
}

/**
 * @summary Updates the attributes, including the name, of a Network Load Balancer (NLB) instance.
 *
 * @param request UpdateLoadBalancerAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerAttributeResponse
 */
async function updateLoadBalancerAttributeWithOptions(request: UpdateLoadBalancerAttributeRequest, runtime: $RuntimeOptions): UpdateLoadBalancerAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.cps)) {
    body['Cps'] = request.cps;
  }
  if (!$isNull(request.crossZoneEnabled)) {
    body['CrossZoneEnabled'] = request.crossZoneEnabled;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.loadBalancerName)) {
    body['LoadBalancerName'] = request.loadBalancerName;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Updates the attributes, including the name, of a Network Load Balancer (NLB) instance.
 *
 * @param request UpdateLoadBalancerAttributeRequest
 * @return UpdateLoadBalancerAttributeResponse
 */
async function updateLoadBalancerAttribute(request: UpdateLoadBalancerAttributeRequest): UpdateLoadBalancerAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerAttributeWithOptions(request, runtime);
}

model UpdateLoadBalancerProtectionRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  deletionProtectionEnabled?: boolean(name='DeletionProtectionEnabled', description='Specifies whether to enable deletion protection. Valid values:

*   **true**
*   **false**', example='false'),
  deletionProtectionReason?: string(name='DeletionProtectionReason', description='The reason why deletion protection is enabled. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.

>  This parameter takes effect only when **DeletionProtectionEnabled** is set to **true**.', example='Instance_Is_Bound_By_Acceleration_Instance'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): sends a request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  modificationProtectionReason?: string(name='ModificationProtectionReason', description='The reason why the configuration read-only mode is enabled. The reason must be 2 to 128 characters in length, can contain letters, digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.

>  This parameter takes effect only when **Status** is set to **ConsoleProtection**.', example='ConsoleProtection'),
  modificationProtectionStatus?: string(name='ModificationProtectionStatus', description='Specifies whether to enable the configuration read-only mode. Valid values:

*   **NonProtection**: disables the configuration read-only mode. In this case, you cannot set the **ModificationProtectionReason** parameter. If you specify **ModificationProtectionReason**, the value is cleared.
*   **ConsoleProtection**: enables the configuration read-only mode. In this case, you can specify **ModificationProtectionReason**.

>  If you set this parameter to **ConsoleProtection**, you cannot use the NLB console to modify configurations of the NLB instance. However, you can call API operations to modify the instance configurations.', example='ConsoleProtection'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
}

model UpdateLoadBalancerProtectionResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateLoadBalancerProtectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerProtectionResponseBody(name='body'),
}

/**
 * @summary Enables or disables the deletion protection feature.
 *
 * @description > You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the details about deletion protection and the configuration read-only mode.
 *
 * @param request UpdateLoadBalancerProtectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerProtectionResponse
 */
async function updateLoadBalancerProtectionWithOptions(request: UpdateLoadBalancerProtectionRequest, runtime: $RuntimeOptions): UpdateLoadBalancerProtectionResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.deletionProtectionEnabled)) {
    body['DeletionProtectionEnabled'] = request.deletionProtectionEnabled;
  }
  if (!$isNull(request.deletionProtectionReason)) {
    body['DeletionProtectionReason'] = request.deletionProtectionReason;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.modificationProtectionReason)) {
    body['ModificationProtectionReason'] = request.modificationProtectionReason;
  }
  if (!$isNull(request.modificationProtectionStatus)) {
    body['ModificationProtectionStatus'] = request.modificationProtectionStatus;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerProtection',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Enables or disables the deletion protection feature.
 *
 * @description > You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the details about deletion protection and the configuration read-only mode.
 *
 * @param request UpdateLoadBalancerProtectionRequest
 * @return UpdateLoadBalancerProtectionResponse
 */
async function updateLoadBalancerProtection(request: UpdateLoadBalancerProtectionRequest): UpdateLoadBalancerProtectionResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerProtectionWithOptions(request, runtime);
}

model UpdateLoadBalancerZonesRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the request. If the request passes the validation, an HTTP 2xx status code is returned and the operation is performed.', example='false'),
  loadBalancerId?: string(name='LoadBalancerId', description='The ID of the NLB instance.

This parameter is required.', example='nlb-83ckzc8d4xlp8o****'),
  regionId?: string(name='RegionId', description='The ID of region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  zoneMappings?: [ 
    {
      allocationId?: string(name='AllocationId', description='The ID of the elastic IP address (EIP) or Anycast EIP.', example='eip-bp1aedxso6u80u0qf****'),
      eipType?: string(name='EipType', description='The type of the EIP. Valid values:

*   **Common**: an EIP
*   **Anycast**: an Anycast EIP

>  For regions that support Anycast EIPs, see [Limits](https://help.aliyun.com/document_detail/470000.html).This parameter is required if **AddressType** is set to **Internet**.', example='Common'),
      privateIPv4Address?: string(name='PrivateIPv4Address', description='The private IP address.', example='192.168.36.16'),
      vSwitchId?: string(name='VSwitchId', description='The ID of the vSwitch in the zone. By default, each zone uses one vSwitch and one subnet.

This parameter is required.', example='vsw-bp1rmcrwg3erh1fh8****'),
      zoneId?: string(name='ZoneId', description='The zone ID. You can call the [DescribeZones](https://help.aliyun.com/document_detail/443890.html) operation to query the most recent zone list.

This parameter is required.', example='cn-hangzhou-a'),
    }
  ](name='ZoneMappings', description='The mappings between the zones and the vSwitches. You can specify up to 10 zones.

This parameter is required.'),
}

model UpdateLoadBalancerZonesResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='CEF72CEB-54B6-4AE8-B225-F876FF7BA984'),
}

model UpdateLoadBalancerZonesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateLoadBalancerZonesResponseBody(name='body'),
}

/**
 * @summary Modifies the zones and zone attributes of a Network Load Balancer (NLB) instance.
 *
 * @description When you call this operation, make sure that you specify all the zones of the NLB instance, including the existing zones and new zones. If you do not specify the existing zones, the existing zones are removed.
 * Prerequisites
 * *   An NLB instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/445868.html).
 * *   You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the zones and zone attributes of an NLB instance.
 * *   **UpdateLoadBalancerZones** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation query to query the status of a task:
 *     *   If the task is in the **Succeeded** state, the zones and zone attributes are modified.
 *     *   If the task is in the **Processing** state, the zones and zone attributes are being modified. In this case, you can perform only query operations.
 *
 * @param request UpdateLoadBalancerZonesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateLoadBalancerZonesResponse
 */
async function updateLoadBalancerZonesWithOptions(request: UpdateLoadBalancerZonesRequest, runtime: $RuntimeOptions): UpdateLoadBalancerZonesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.loadBalancerId)) {
    body['LoadBalancerId'] = request.loadBalancerId;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.zoneMappings)) {
    body['ZoneMappings'] = request.zoneMappings;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateLoadBalancerZones',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the zones and zone attributes of a Network Load Balancer (NLB) instance.
 *
 * @description When you call this operation, make sure that you specify all the zones of the NLB instance, including the existing zones and new zones. If you do not specify the existing zones, the existing zones are removed.
 * Prerequisites
 * *   An NLB instance is created. For more information, see [CreateLoadBalancer](https://help.aliyun.com/document_detail/445868.html).
 * *   You can call the [GetLoadBalancerAttribute](https://help.aliyun.com/document_detail/445873.html) operation to query the zones and zone attributes of an NLB instance.
 * *   **UpdateLoadBalancerZones** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background. You can call the [GetJobStatus](https://help.aliyun.com/document_detail/445904.html) operation query to query the status of a task:
 *     *   If the task is in the **Succeeded** state, the zones and zone attributes are modified.
 *     *   If the task is in the **Processing** state, the zones and zone attributes are being modified. In this case, you can perform only query operations.
 *
 * @param request UpdateLoadBalancerZonesRequest
 * @return UpdateLoadBalancerZonesResponse
 */
async function updateLoadBalancerZones(request: UpdateLoadBalancerZonesRequest): UpdateLoadBalancerZonesResponse {
  var runtime = new $RuntimeOptions{};
  return updateLoadBalancerZonesWithOptions(request, runtime);
}

model UpdateSecurityPolicyAttributeRequest {
  ciphers?: [ string ](name='Ciphers', description='The supported cipher suites. Valid values of this parameter vary base on the value of TlsVersions. You can specify up to 32 cipher suites.

TLSv1.0 and TLSv1.1 support the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**

TLSv1.2 supports the following cipher suites:

*   **ECDHE-ECDSA-AES128-SHA**
*   **ECDHE-ECDSA-AES256-SHA**
*   **ECDHE-RSA-AES128-SHA**
*   **ECDHE-RSA-AES256-SHA**
*   **AES128-SHA**
*   **AES256-SHA**
*   **DES-CBC3-SHA**
*   **ECDHE-ECDSA-AES128-GCM-SHA256**
*   **ECDHE-ECDSA-AES256-GCM-SHA384**
*   **ECDHE-ECDSA-AES128-SHA256**
*   **ECDHE-ECDSA-AES256-SHA384**
*   **ECDHE-RSA-AES128-GCM-SHA256**
*   **ECDHE-RSA-AES256-GCM-SHA384**
*   **ECDHE-RSA-AES128-SHA256**
*   **ECDHE-RSA-AES256-SHA384**
*   **AES128-GCM-SHA256**
*   **AES256-GCM-SHA384**
*   **AES128-SHA256**
*   **AES256-SHA256**

TLSv1.3 supports the following cipher suites:

*   **TLS_AES_128_GCM_SHA256**
*   **TLS_AES_256_GCM_SHA384**
*   **TLS_CHACHA20_POLY1305_SHA256**
*   **TLS_AES_128_CCM_SHA256**
*   **TLS_AES_128_CCM_8_SHA256**'),
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not set this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.

This parameter is required.', example='tls-bp14bb1e7dll4f****'),
  securityPolicyName?: string(name='SecurityPolicyName', description='The name of the security policy.

The name must be 1 to 200 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).', example='TLSCipherPolicy'),
  tlsVersions?: [ string ](name='TlsVersions', description='The supported TLS versions. Valid values: **TLSv1.0**, **TLSv1.1**, **TLSv1.2**, and **TLSv1.3**. You can specify up to four TLS versions.'),
}

model UpdateSecurityPolicyAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='D7A8875F-373A-5F48-8484-25B07A61F2AF'),
  securityPolicyId?: string(name='SecurityPolicyId', description='The ID of the TLS security policy.', example='tls-bp14bb1e7dll4f****'),
}

model UpdateSecurityPolicyAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateSecurityPolicyAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a security policy for a Network Load Balancer (NLB) instance.
 *
 * @param request UpdateSecurityPolicyAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateSecurityPolicyAttributeResponse
 */
async function updateSecurityPolicyAttributeWithOptions(request: UpdateSecurityPolicyAttributeRequest, runtime: $RuntimeOptions): UpdateSecurityPolicyAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.ciphers)) {
    body['Ciphers'] = request.ciphers;
  }
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.securityPolicyId)) {
    body['SecurityPolicyId'] = request.securityPolicyId;
  }
  if (!$isNull(request.securityPolicyName)) {
    body['SecurityPolicyName'] = request.securityPolicyName;
  }
  if (!$isNull(request.tlsVersions)) {
    body['TlsVersions'] = request.tlsVersions;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateSecurityPolicyAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations of a security policy for a Network Load Balancer (NLB) instance.
 *
 * @param request UpdateSecurityPolicyAttributeRequest
 * @return UpdateSecurityPolicyAttributeResponse
 */
async function updateSecurityPolicyAttribute(request: UpdateSecurityPolicyAttributeRequest): UpdateSecurityPolicyAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateSecurityPolicyAttributeWithOptions(request, runtime);
}

model UpdateServerGroupAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate the token. Ensure that the token is unique among different requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** The value of **RequestId** is different for each request.', example='123e4567-e89b-12d3-a456-426655440000'),
  connectionDrainEnabled?: boolean(name='ConnectionDrainEnabled', description='Specifies whether to enable connection draining. Valid values:

*   **true**
*   **false**', example='false'),
  connectionDrainTimeout?: int32(name='ConnectionDrainTimeout', description='Specify a timeout period for connection draining. Unit: seconds. Valid values: **0** to **900**.', example='10'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run. Valid values:

*   **true**: validates the request without performing the operation. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the validation, the corresponding error message is returned. If the request passes the validation, the `DryRunOperation` error code is returned.
*   **false** (default): validates the request and performs the operation. If the request passes the validation, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  healthCheckConfig?: {
    healthCheckConnectPort?: int32(name='HealthCheckConnectPort', description='The backend port that is used for health checks. Valid values: **0** to **65535**. If you set this parameter to **0**, the port that the backend server uses to provide services is also used for health checks.', example='0'),
    healthCheckConnectTimeout?: int32(name='HealthCheckConnectTimeout', description='The timeout period for a health check response. Unit: seconds. Valid values: **1 to 300**. Default value: **5**', example='100'),
    healthCheckDomain?: string(name='HealthCheckDomain', description='The domain name used for health checks. Valid values:

*   **$SERVER_IP**: the internal IP address of a backend server.
*   **domain**: the specified domain name. The domain name must be 1 to 80 characters in length, and can contain lowercase letters, digits, hyphens (-), and periods (.).

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='$SERVER_IP'),
    healthCheckEnabled?: boolean(name='HealthCheckEnabled', description='Specifies whether to enable health checks. Valid values:

*   **true**
*   **false**', example='false'),
    healthCheckExp?: string(name='HealthCheckExp', description='The response string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits.', example='ok'),
    healthCheckHttpCode?: [ string ](name='HealthCheckHttpCode', description='The HTTP status codes to return for health checks. Separate multiple HTTP status codes with commas (,). Valid values: **http_2xx** (default), **http_3xx**, **http_4xx**, and **http_5xx**.

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.'),
    healthCheckHttpVersion?: string(name='HealthCheckHttpVersion'),
    healthCheckInterval?: int32(name='HealthCheckInterval', description='The interval at which health checks are performed. Unit: seconds. Default value: **5**

*   If you set **HealthCheckType** to **TCP** or **HTTP**, valid values are **1 to 50**.
*   If you set **HealthCheckType** to **UDP**, valid values are **1 to 300**. Set the health check interval equal to or larger than the response timeout period to ensure that UDP response timeouts are not determined as no responses.', example='5'),
    healthCheckReq?: string(name='HealthCheckReq', description='The request string of UDP health checks. The string must be 1 to 512 characters in length, and can contain letters and digits.', example='hello'),
    healthCheckType?: string(name='HealthCheckType', description='The protocol that you want to use for health checks. Valid values:

*   **TCP**
*   **HTTP**
*   **UDP**', example='TCP'),
    healthCheckUrl?: string(name='HealthCheckUrl', description='The path to which health check probes are sent.

The path must be 1 to 80 characters in length and can contain only letters, digits, and the following special characters: `- / . % ? # & =`. It can also contain the following extended characters: `_ ; ~ ! ( ) * [ ] @ $ ^ : \\\\" , +`. It must start with a forward slash (/).

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='/test/index.html'),
    healthyThreshold?: int32(name='HealthyThreshold', description='The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status changes from **fail** to **success**. Valid values: **2** to **10**.', example='3'),
    httpCheckMethod?: string(name='HttpCheckMethod', description='The HTTP method used for health checks. Valid values: **GET** and **HEAD**.

>  This parameter takes effect only if you set **HealthCheckType** to **HTTP**.', example='GET'),
    unhealthyThreshold?: int32(name='UnhealthyThreshold', description='The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status changes from **success** to **fail**. Valid values: **2** to **10**.', example='3'),
  }(name='HealthCheckConfig', description='Health check configurations.'),
  preserveClientIpEnabled?: boolean(name='PreserveClientIpEnabled', description='Specifies whether to enable client IP preservation. Valid values:

*   **true**
*   **false**

>  You cannot set this parameter to **true** if **PreserveClientIpEnabled** is set to **false** and the server group is associated with a listener that uses **SSL over TCP**.', example='false'),
  regionId?: string(name='RegionId', description='The ID of the region where the NLB instance is deployed.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  scheduler?: string(name='Scheduler', description='The scheduling algorithm. Valid values:

*   **Wrr**: weighted round-robin. Backend servers with higher weights receive more requests.
*   **Wlc**: weighted least connections. Requests are distributed based on the weight and load of each backend server. The load refers to the number of connections on a backend server. If multiple backend servers have the same weight, requests are forwarded to the backend server with the least connections.
*   **rr**: Requests are forwarded to backend servers in sequence.
*   **sch**: source IP hash. Requests from the same source IP address are forwarded to the same backend server.
*   **tch**: consistent hashing based on four factors: source IP address, destination IP address, source port, and destination port. Requests that contain the same four factors are forwarded to the same backend server.
*   **qch**: QUIC ID hash. Requests that contain the same QUIC ID are forwarded to the same backend server.

>  QUIC ID hash is supported only when the backend protocol is set to UDP.', example='Wrr'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtoptyui****'),
  serverGroupName?: string(name='ServerGroupName', description='The new name of the server group.

The name must be 2 to 128 characters in length, can contain digits, periods (.), underscores (_), and hyphens (-), and must start with a letter.', example='NLB_ServerGroup1'),
}

model UpdateServerGroupAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-atstuj3rtoptyui****'),
}

model UpdateServerGroupAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServerGroupAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the configurations of a Network Load Balancer (NLB) server group.
 *
 * @param request UpdateServerGroupAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServerGroupAttributeResponse
 */
async function updateServerGroupAttributeWithOptions(request: UpdateServerGroupAttributeRequest, runtime: $RuntimeOptions): UpdateServerGroupAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.connectionDrainEnabled)) {
    body['ConnectionDrainEnabled'] = request.connectionDrainEnabled;
  }
  if (!$isNull(request.connectionDrainTimeout)) {
    body['ConnectionDrainTimeout'] = request.connectionDrainTimeout;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  var bodyFlat : map[string]any = {};
  if (!$isNull(request.healthCheckConfig)) {
    bodyFlat['HealthCheckConfig'] = request.healthCheckConfig;
  }
  if (!$isNull(request.preserveClientIpEnabled)) {
    body['PreserveClientIpEnabled'] = request.preserveClientIpEnabled;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.scheduler)) {
    body['Scheduler'] = request.scheduler;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.serverGroupName)) {
    body['ServerGroupName'] = request.serverGroupName;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServerGroupAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the configurations of a Network Load Balancer (NLB) server group.
 *
 * @param request UpdateServerGroupAttributeRequest
 * @return UpdateServerGroupAttributeResponse
 */
async function updateServerGroupAttribute(request: UpdateServerGroupAttributeRequest): UpdateServerGroupAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateServerGroupAttributeWithOptions(request, runtime);
}

model UpdateServerGroupServersAttributeRequest {
  clientToken?: string(name='ClientToken', description='The client token used to ensure the idempotence of the request.

You can use the client to generate this value. Ensure that the value is unique among all requests. Only ASCII characters are allowed.

>  If you do not specify this parameter, the value of **RequestId** is used.**** **RequestId** of each request is different.', example='123e4567-e89b-12d3-a456-426655440000'),
  dryRun?: boolean(name='DryRun', description='Specifies whether to perform a dry run, without sending the actual request. Valid values:

*   **true**: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the `DryRunOperation` error code is returned.
*   **false** (default): performs a dry run and sends the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.', example='false'),
  regionId?: string(name='RegionId', description='The region ID of the NLB instance.

You can call the [DescribeRegions](https://help.aliyun.com/document_detail/443657.html) operation to query the most recent region list.', example='cn-hangzhou'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.

This parameter is required.', example='sgp-atstuj3rtoptyui****'),
  servers?: [ 
    {
      description?: string(name='Description', description='The description of the backend server.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), periods (.), semicolons (;), forward slashes (/), at sings (@), underscores (_), and hyphens (-).', example='test'),
      port?: int32(name='Port', description='The port used by the backend server. Valid values: **1** to **65535**.

>  This parameter cannot be modified.

This parameter is required.', example='443'),
      serverId?: string(name='ServerId', description='The backend server ID.

*   If the server group is of the **Instance** type, set this parameter to the IDs of servers of the **Ecs**, **Eni**, or **Eci** type.
*   If the server group is of the **Ip** type, set this parameter to IP addresses.

This parameter is required.', example='ecs-bp67acfmxazb4p****'),
      serverIp?: string(name='ServerIp', description='The IP addresses of servers. If the server group type is **Ip**, set the ServerId parameter to IP addresses.', example='192.168.6.6'),
      serverType?: string(name='ServerType', description='The type of the backend server. Valid values:

*   **Ecs**: Elastic Compute Service (ECS) instance
*   **Eni**: elastic network interface (ENI)
*   **Eci**: elastic container instance
*   **Ip**: IP address

This parameter is required.', example='Ecs'),
      weight?: int32(name='Weight', description='The weight of the backend server. Valid values: **0** to **100**. Default value: **100**. If the value is set to **0**, no requests are forwarded to the server.', example='100'),
    }
  ](name='Servers', description='The backend servers. You can specify at most 200 backend servers in each call.

This parameter is required.'),
}

model UpdateServerGroupServersAttributeResponseBody = {
  jobId?: string(name='JobId', description='The ID of the asynchronous task.', example='72dcd26b-f12d-4c27-b3af-18f6aed5****'),
  requestId?: string(name='RequestId', description='The request ID.', example='54B48E3D-DF70-471B-AA93-08E683A1B45'),
  serverGroupId?: string(name='ServerGroupId', description='The server group ID.', example='sgp-atstuj3rtoptyui****'),
}

model UpdateServerGroupServersAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateServerGroupServersAttributeResponseBody(name='body'),
}

/**
 * @summary Modifies the weights and descriptions of backend servers in a server group of a Network Load Balancer (NLB) instance.
 *
 * @description **UpdateServerGroupServersAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/445895.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, the server group is being modified.
 *     *   If a server group is in the **Available** state, the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/445896.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Configuring** state, it indicates that the backend server is being modified.
 *     *   If a backend server is in the **Available** state, it indicates that the backend server is running.
 *
 * @param request UpdateServerGroupServersAttributeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateServerGroupServersAttributeResponse
 */
async function updateServerGroupServersAttributeWithOptions(request: UpdateServerGroupServersAttributeRequest, runtime: $RuntimeOptions): UpdateServerGroupServersAttributeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.clientToken)) {
    body['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.dryRun)) {
    body['DryRun'] = request.dryRun;
  }
  if (!$isNull(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!$isNull(request.serverGroupId)) {
    body['ServerGroupId'] = request.serverGroupId;
  }
  if (!$isNull(request.servers)) {
    body['Servers'] = request.servers;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateServerGroupServersAttribute',
    version = '2022-04-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary Modifies the weights and descriptions of backend servers in a server group of a Network Load Balancer (NLB) instance.
 *
 * @description **UpdateServerGroupServersAttribute** is an asynchronous operation. After a request is sent, the system returns a request ID and runs the task in the background.
 * 1.  You can call the [ListServerGroups](https://help.aliyun.com/document_detail/445895.html) operation to query the status of a server group.
 *     *   If a server group is in the **Configuring** state, the server group is being modified.
 *     *   If a server group is in the **Available** state, the server group is running.
 * 2.  You can call the [ListServerGroupServers](https://help.aliyun.com/document_detail/445896.html) operation to query the status of a backend server.
 *     *   If a backend server is in the **Configuring** state, it indicates that the backend server is being modified.
 *     *   If a backend server is in the **Available** state, it indicates that the backend server is running.
 *
 * @param request UpdateServerGroupServersAttributeRequest
 * @return UpdateServerGroupServersAttributeResponse
 */
async function updateServerGroupServersAttribute(request: UpdateServerGroupServersAttributeRequest): UpdateServerGroupServersAttributeResponse {
  var runtime = new $RuntimeOptions{};
  return updateServerGroupServersAttributeWithOptions(request, runtime);
}

